<?php
//class Application_Form_Tester extends Twitter_Bootstrap3_Form_Horizontal
class Application_Form_Tester extends Twitter_Bootstrap3_Form_Vertical
{
    
    public function init()
    {
        $this->addElement('hidden', 'hidden', [
            'value' => 'hidden value',
        ]);
        
        $this->addElement('hash', 'csrf');
        $csrf = $this->getElement('csrf');
        $csrf->initCsrfToken();
        $csrf->initCsrfValidator();
        
        $this->addElement('text', 'text', [
            'label' => 'text',
            'value' => 'text — value',
//            'disabled' => true,
        ]);
        
        $this->addElement('textarea', 'textarea', [
            'label' => 'textarea',
            'value' => 'textarea — value',
            'rows' => 4,
//            'disabled' => true,
        ]);
        
        $this->addElement('password', 'password', [
            'label' => 'password',
            'renderPassword' => false,
            'value' => 'password — value',
//            'disabled' => true,
        ]);
        
        $this->addElement('select', 'select', [
            'label' => 'select',
            'multiOptions' => [
                1 => 'one',
                2 => 'two',
                3 => 'three',
            ],
            'multiple' => false,
//            'disabled' => true,
        ]);
        
        $this->addElement('multiselect', 'multiselect', [
            'label' => 'multiselect',
            'multiOptions' => [
                '1' => 'Январь',
                '2' => 'Февраль',
                '3' => 'Март',
                '4' => 'Апрель',
                '5' => 'Май',
                '6' => 'Июнь',
                '7' => 'Июль',
                '8' => 'Август',
                '9' => 'Сентябрь',
                '10' => 'Октябрь',
                '11' => 'Ноябрь',
                '12' => 'Декабрь',
            ],
//            'disabled' => true,
        ]);
        
        $this->addElement('note', 'note', [
            'label' => 'note',
            'value' => '<i>Note</i>',
            'escape' => false,
        ]);
        
        $this->addElement('static', 'static', [
            'label' => 'static',
            'value' => 'Static',
        ]);
        
        $this->addElement('file', 'file', [
            'label' => 'file',
//            'disabled' => true,
        ]);
        
        $this->addElement('checkbox', 'checkbox', [
            'label' => 'checkbox',
            'disableHidden' => false,
            'checkedValue' => 'checked Value',
            'uncheckedValue' => 'unchecked Value',
//            'disabled' => true,
        ]);
        
        $this->addElement('multiCheckbox', 'multiCheckbox', [
            'label' => 'multiCheckbox',
            'multiOptions' => [
                '1' => 'Январь',
                '2' => 'Февраль',
                '3' => 'Март',
                '4' => 'Апрель',
                '5' => 'Май',
                '6' => 'Июнь',
                '7' => 'Июль',
                '8' => 'Август',
                '9' => 'Сентябрь',
                '10' => 'Октябрь',
                '11' => 'Ноябрь',
                '12' => 'Декабрь',
            ],
//            'disabled' => true,
        ]);
        
        $this->addElement('radio', 'radio', [
            'label' => 'radio',
            'multiOptions' => [
                '1' => 'Январь',
                '2' => 'Февраль',
                '3' => 'Март',
                '4' => 'Апрель',
                '5' => 'Май',
                '6' => 'Июнь',
                '7' => 'Июль',
                '8' => 'Август',
                '9' => 'Сентябрь',
                '10' => 'Октябрь',
                '11' => 'Ноябрь',
                '12' => 'Декабрь',
            ],
//            'disabled' => true,
        ]);
        
        // HTML5
        $this->addElement('color',         'color',         ['label' => 'color']);
        $this->addElement('date',          'date',          ['label' => 'date']);
        $this->addElement('dateTime',      'dateTime',      ['label' => 'dateTime']);
        $this->addElement('dateTimeLocal', 'dateTimeLocal', ['label' => 'dateTimeLocal']);
        $this->addElement('email',         'email',         ['label' => 'email']);
        $this->addElement('month',         'month',         ['label' => 'month']);
        $this->addElement('number',        'number',        ['label' => 'number']);
        $this->addElement('search',        'search',        ['label' => 'search']);
        $this->addElement('tel',           'tel',           ['label' => 'tel']);
        $this->addElement('url',           'url',           ['label' => 'url']);
        $this->addElement('week',          'week',          ['label' => 'week']);
        
        $this->addElement('captcha', 'captcha', [
            'label' => 'captcha',
            'captcha' => [
                'captcha' => 'Figlet',
                'wordLen' => 6,
                'timeout' => 300,
            ],
        ]);
        
        $this->addElement('button', 'button', [
            'label' => 'button — label',
            'value' => 'button — value',
            'title' => 'submit — title',
//            'content' => 'button — content',  // в коде обрабатывается, но по факту – нет
//            'disabled' => true,
            'escape' => false,
//            'class' => 'btn-default',
        ]);
        
        $this->addElement('submit', 'submit', [
            'label' => 'submit',
            'value' => 'submit — value',
            'title' => 'submit — title',
//            'disabled' => true,
//            'class' => 'btn-default',
//            'ignore' => true,
        ]);
        
        $this->addElement('reset', 'reset', [
            'label' => 'reset',
            'value' => 'reset — value',
            'title' => 'reset — title',
//            'disabled' => true,
//            'class' => 'btn-default',
        ]);
        
        $this->addElement('image', 'image', [
            'src' => 'http://meals4kids.org/sites/default/files/submit%20button_2.jpg',
            'value' => '',
        ]);
    }
}