<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect1 id="zend.form.standardElements">
    <title>Standard Form Elements Shipped With Zend Framework</title>

    <para>
        Zend Framework ships with concrete element classes covering most HTML
        form elements. Most simply specify a particular view helper for use when
        decorating the element, but several offer additional functionality. The
        following is a list of all such classes, as well as descriptions of the
        functionality they offer.
    </para>

    <sect2 id="zend.form.standardElements.button">
        <title>Zend_Form_Element_Button</title>

        <para>
            Used for creating HTML button elements,
            <classname>Zend_Form_Element_Button</classname> extends <link
                linkend="zend.form.standardElements.submit">Zend_Form_Element_Submit</link>,
            specifying some custom functionality. It specifies the 'formButton'
            view helper for decoration.
        </para>

        <para>
            Like the submit element, it uses the element's label as the element
            value for display purposes; in other words, to set the text of the
            button, set the value of the element. The label will be translated
            if a translation adapter is present.
        </para>

        <para>
            Because the label is used as part of the element, the button element
            uses only the <link
                linkend="zend.form.standardDecorators.viewHelper">ViewHelper</link>
            and <link
                linkend="zend.form.standardDecorators.dtDdWrapper">DtDdWrapper</link>
            decorators.
        </para>

        <para>
            After populating or validating a form, you can check if the given
            button was clicked using the <methodname>isChecked()</methodname> method.
        </para>
    </sect2>

    <sect2 id="zend.form.standardElements.captcha">
        <title>Zend_Form_Element_Captcha</title>

        <para>
            CAPTCHAs are used to prevent automated submission of forms by bots
            and other automated processes.
        </para>

        <para>
            The Captcha form element allows you to specify which <link
                linkend="zend.captcha.adapters">Zend_Captcha adapter</link> you
            wish to utilize as a form CAPTCHA. It then sets this adapter as a
            validator to the object, and uses a Captcha decorator for rendering
            (which proxies to the CAPTCHA adapter).
        </para>

        <para>
            Adapters may be any adapters in <classname>Zend_Captcha</classname>, as well
            as any custom adapters you may have defined elsewhere. To allow
            this, you may pass an additional plugin loader type key, 'CAPTCHA'
            or 'captcha', when specifying a plugin loader prefix path:
        </para>

        <programlisting language="php"><![CDATA[
$element->addPrefixPath('My_Captcha', 'My/Captcha/', 'captcha');
]]></programlisting>

        <para>
            Captcha's may then be registered using the <methodname>setCaptcha()</methodname>
            method, which can take either a concrete CAPTCHA instance, or the
            short name of a CAPTCHA adapter:
        </para>

        <programlisting language="php"><![CDATA[
// Concrete instance:
$element->setCaptcha(new Zend_Captcha_Figlet());

// Using shortnames:
$element->setCaptcha('Dumb');
]]></programlisting>

        <para>
            If you wish to load your element via configuration, specify either
            the key 'captcha' with an array containing the key 'captcha', or
            both the keys 'captcha' and 'captchaOptions':
        </para>

        <programlisting language="php"><![CDATA[
// Using single captcha key:
$element = new Zend_Form_Element_Captcha('foo', array(
    'label' => "Please verify you're a human",
    'captcha' => array(
        'captcha' => 'Figlet',
        'wordLen' => 6,
        'timeout' => 300,
    ),
));

// Using both captcha and captchaOptions:
$element = new Zend_Form_Element_Captcha('foo', array(
    'label' => "Please verify you're a human"
    'captcha' => 'Figlet',
    'captchaOptions' => array(
        'captcha' => 'Figlet',
        'wordLen' => 6,
        'timeout' => 300,
    ),
));
]]></programlisting>

        <para>
            The decorator used is determined by querying the captcha adapter. By
            default, the <link
                linkend="zend.form.standardDecorators.captcha">Captcha
                decorator</link> is used, but an adapter may specify a different
            one via its <methodname>getDecorator()</methodname> method.
        </para>

        <para>
            As noted, the captcha adapter itself acts as a validator for the
            element. Additionally, the NotEmpty validator is not used, and the
            element is marked as required. In most cases, you should need to do
            nothing else to have a captcha present in your form.
        </para>
    </sect2>

    <sect2 id="zend.form.standardElements.checkbox">
        <title>Zend_Form_Element_Checkbox</title>

        <para>
            HTML checkboxes allow you return a specific value, but basically<commit_msg>[ZF-8766] Sample code error - missing comma after setting label<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect1 id="zend.form.standardElements">
    <title>Standard Form Elements Shipped With Zend Framework</title>

    <para>
        Zend Framework ships with concrete element classes covering most HTML
        form elements. Most simply specify a particular view helper for use when
        decorating the element, but several offer additional functionality. The
        following is a list of all such classes, as well as descriptions of the
        functionality they offer.
    </para>

    <sect2 id="zend.form.standardElements.button">
        <title>Zend_Form_Element_Button</title>

        <para>
            Used for creating HTML button elements,
            <classname>Zend_Form_Element_Button</classname> extends <link
                linkend="zend.form.standardElements.submit">Zend_Form_Element_Submit</link>,
            specifying some custom functionality. It specifies the 'formButton'
            view helper for decoration.
        </para>

        <para>
            Like the submit element, it uses the element's label as the element
            value for display purposes; in other words, to set the text of the
            button, set the value of the element. The label will be translated
            if a translation adapter is present.
        </para>

        <para>
            Because the label is used as part of the element, the button element
            uses only the <link
                linkend="zend.form.standardDecorators.viewHelper">ViewHelper</link>
            and <link
                linkend="zend.form.standardDecorators.dtDdWrapper">DtDdWrapper</link>
            decorators.
        </para>

        <para>
            After populating or validating a form, you can check if the given
            button was clicked using the <methodname>isChecked()</methodname> method.
        </para>
    </sect2>

    <sect2 id="zend.form.standardElements.captcha">
        <title>Zend_Form_Element_Captcha</title>

        <para>
            CAPTCHAs are used to prevent automated submission of forms by bots
            and other automated processes.
        </para>

        <para>
            The Captcha form element allows you to specify which <link
                linkend="zend.captcha.adapters">Zend_Captcha adapter</link> you
            wish to utilize as a form CAPTCHA. It then sets this adapter as a
            validator to the object, and uses a Captcha decorator for rendering
            (which proxies to the CAPTCHA adapter).
        </para>

        <para>
            Adapters may be any adapters in <classname>Zend_Captcha</classname>, as well
            as any custom adapters you may have defined elsewhere. To allow
            this, you may pass an additional plugin loader type key, 'CAPTCHA'
            or 'captcha', when specifying a plugin loader prefix path:
        </para>

        <programlisting language="php"><![CDATA[
$element->addPrefixPath('My_Captcha', 'My/Captcha/', 'captcha');
]]></programlisting>

        <para>
            Captcha's may then be registered using the <methodname>setCaptcha()</methodname>
            method, which can take either a concrete CAPTCHA instance, or the
            short name of a CAPTCHA adapter:
        </para>

        <programlisting language="php"><![CDATA[
// Concrete instance:
$element->setCaptcha(new Zend_Captcha_Figlet());

// Using shortnames:
$element->setCaptcha('Dumb');
]]></programlisting>

        <para>
            If you wish to load your element via configuration, specify either
            the key 'captcha' with an array containing the key 'captcha', or
            both the keys 'captcha' and 'captchaOptions':
        </para>

        <programlisting language="php"><![CDATA[
// Using single captcha key:
$element = new Zend_Form_Element_Captcha('foo', array(
    'label' => "Please verify you're a human",
    'captcha' => array(
        'captcha' => 'Figlet',
        'wordLen' => 6,
        'timeout' => 300,
    ),
));

// Using both captcha and captchaOptions:
$element = new Zend_Form_Element_Captcha('foo', array(
    'label' => "Please verify you're a human",
    'captcha' => 'Figlet',
    'captchaOptions' => array(
        'captcha' => 'Figlet',
        'wordLen' => 6,
        'timeout' => 300,
    ),
));
]]></programlisting>

        <para>
            The decorator used is determined by querying the captcha adapter. By
            default, the <link
                linkend="zend.form.standardDecorators.captcha">Captcha
                decorator</link> is used, but an adapter may specify a different
            one via its <methodname>getDecorator()</methodname> method.
        </para>

        <para>
            As noted, the captcha adapter itself acts as a validator for the
            element. Additionally, the NotEmpty validator is not used, and the
            element is marked as required. In most cases, you should need to do
            nothing else to have a captcha present in your form.
        </para>
    </sect2>

    <sect2 id="zend.form.standardElements.checkbox">
        <title>Zend_Form_Element_Checkbox</title>

        <para>
            HTML checkboxes allow you return a specific value, but basically
{'fraction_non_alphanumeric': 0.0892975011786893, 'fraction_numerical': 0.003583215464403583, 'mean_word_length': 2.3542061986084755, 'pattern_counts': {'":': 0, '<': 143, '<?xml version=': 2, '>': 171, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1463717', 'n_tokens_mistral': 2915, 'n_tokens_neox': 2742, 'n_words': 1021}