* @package tao */ class tao_actions_form_List extends tao_helpers_form_FormContainer { // --- ASSOCIATIONS --- // --- ATTRIBUTES --- // --- OPERATIONS --- /** * Short description of method initForm * * @access public * @author Bertrand Chevrier, * @return mixed */ public function initForm() { $this->form = tao_helpers_form_FormFactory::getForm('list'); $addElt = tao_helpers_form_FormFactory::getElement('add', 'Free'); $addElt->setValue(' ' . __('Add') . ''); $this->form->setActions([$addElt], 'bottom'); $this->form->setActions([], 'top'); } /** * Short description of method initElements * * @access public * @author Bertrand Chevrier, * @return mixed */ public function initElements() { $labelElt = tao_helpers_form_FormFactory::getElement('label', 'Textbox'); $labelElt->setDescription(__('Name')); $labelElt->addValidator(tao_helpers_form_FormFactory::getValidator('NotEmpty')); $this->form->addElement($labelElt); $sizeElt = tao_helpers_form_FormFactory::getElement('size', 'Textbox'); $sizeElt->setDescription(__('Number of elements')); $sizeElt->setAttribute('size', '4'); $sizeElt->setValue(1); $sizeElt->addValidators([ tao_helpers_form_FormFactory::getValidator('NotEmpty'), tao_helpers_form_FormFactory::getValidator('Integer', ['min' => 1]) ]); $this->form->addElement($sizeElt); } }