public function __construct($name = null) { parent::__construct('users'); $this->setAttribute('class', ''); $this->setAttribute('method', 'post'); $id = new Element\Hidden('id'); $id->setAttribute('class', 'primarykey'); // $username = new Element\Text('username'); // $username->setLabel('User Name') // ->setAttribute('class', 'required inputfullwidth') // ->setAttribute('maxlength', '100') // ->setAttribute('placeholder', 'Username'); $email = new Element\Email('email'); $email->setLabel('Email')->setAttribute('class', 'required email inputfullwidth')->setAttribute('maxlength', '100')->setAttribute('placeholder', 'Email'); $password = new Element\Password('password'); $password->setLabel('Password')->setAttribute('class', 'required passValid inputfullwidth')->setAttribute('id', 'inputPassword')->setAttribute('maxlength', '100')->setAttribute('min', '6')->setAttribute('placeholder', 'Password'); $repassword = new Element\Password('repassword'); $repassword->setLabel('Confirm Password')->setAttribute('class', 'required inputfullwidth')->setAttribute('id', 'inputPassword')->setAttribute('maxlength', '100')->setAttribute('min', '6')->setAttribute('placeholder', 'Confirm Password'); $first_name = new Element\Text('first_name'); $first_name->setLabel('First Name')->setAttribute('class', 'required inputfullwidth')->setAttribute('maxlength', '100')->setAttribute('placeholder', 'First Name'); $last_name = new Element\Text('last_name'); $last_name->setLabel('Last Name')->setAttribute('class', 'required inputfullwidth')->setAttribute('maxlength', '100')->setAttribute('placeholder', 'Last Name'); $submit = new Element\Submit('submit'); $submit->setValue('Join Now')->setAttribute('class', 'btn btn-large btn-success btn-hossbrag join-now-home fullwidth'); $this->add($id); $this->add($first_name); $this->add($last_name); // $this->add($username); $this->add($email); $this->add($password); $this->add($repassword); $this->add($submit); }
public function getForm(array $defaultStatus) { if (!$this->form) { $currencyId = new Element\Hidden(); $currencyId->setName('currencyId'); $name = new Element\Text(); $name->setLabel('Name')->setName("name")->setAttribute('class', 'form-control'); $code = new Element\Text(); $code->setLabel('Code')->setName("code")->setAttribute('class', 'form-control'); $rate = new Element\Text(); $rate->setLabel('Rate')->setName("rate")->setAttributes(array('class' => 'form-control')); $status = new Element\Select(); $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($defaultStatus); $changedRate = new Element\Checkbox(); $changedRate->setName('changedRate')->setLabel('Auto renew?')->setAttribute('class', 'form-control'); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->add($currencyId); $form->add($code); $form->add($name); $form->add($rate); $form->add($status); $form->add($changedRate); $this->form = $form; } return $this->form; }
public function __construct($name = null) { parent::__construct('objetosform'); $this->setAttribute('method', 'post'); $this->setAttribute('role', 'form'); $this->setAttributes(array('id' => 'objetosform')); $objetos_actividad_id = new Element('objetos_actividad_id'); $objetos_actividad_id->setLabel('Actividad'); $objetos_actividad_id->setAttributes(array('type' => 'text', 'placeholder' => 'Este campo se genera automáticamente', 'id' => 'objetos_actividad_id', 'readonly' => 'readonly', 'class' => 'form-control')); $objetos_id = new Element('objetos_id'); $objetos_id->setLabel('ID'); $objetos_id->setAttributes(array('type' => 'text', 'placeholder' => 'Este campo se genera automáticamente', 'id' => 'objetos_id', 'readonly' => 'readonly', 'class' => 'form-control')); $objetos_nombre = new Element('objetos_nombre'); $objetos_nombre->setLabel('Nombre'); $objetos_nombre->setAttributes(array('type' => 'text', 'placeholder' => 'ej: wKER001', 'id' => 'objetos_nombre', 'class' => 'form-control')); $objetos_tipo = new Element\Select('objetos_tipo'); $objetos_tipo->setLabel('Tipo'); $objetos_tipo->setEmptyOption('Elige un Tipo..'); $objetos_tipo->setOptions(array('disable_inarray_validator' => true)); $objetos_tipo->setAttributes(array('id' => 'objetos_tipo', 'class' => "form-control")); $guardar = new Element\Button('guardar'); $guardar->setAttributes(array('class' => 'btn btn-success mr5', 'type' => 'submit', 'id' => 'guardar')); $guardar->setOptions(array('label' => '<i class="glyphicon glyphicon-floppy-disk"></i>', 'label_options' => array('disable_html_escape' => true))); $etiquetas_id = new Element\Hidden('etiquetas_id'); $etiquetas_id->setAttributes(array('id' => 'etiquetas_id')); $this->add($objetos_actividad_id); $this->add($objetos_id); $this->add($objetos_nombre); $this->add($objetos_tipo); $this->add($etiquetas_id); $this->add($guardar); }
public function __construct($name = null) { parent::__construct('reginfo'); $id_hidden = new Element\Hidden('id'); $id_hidden->setName('id'); $email_text = new Element\Text('login'); $email_text->setLabel('E-mail'); $email_text->setLabelAttributes(array('class' => 'type_text')); $email_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'disabled' => 'disable')); $type_text = new Element\Text('type'); $type_text->setLabel('Type'); $type_text->setLabelAttributes(array('class' => 'type_text')); $type_text->setAttributes(array('class' => 'type_text_input', 'disabled' => 'disable')); $password_text = new Element\Password('password'); $password_text->setLabel('New password'); $password_text->setLabelAttributes(array('class' => 'type_text')); $password_text->setAttributes(array('id' => 'password', 'class' => 'type_text_input')); $cpassword_text = new Element\Password('cpassword'); $cpassword_text->setLabel('Confirm password'); $cpassword_text->setLabelAttributes(array('class' => 'type_text')); $cpassword_text->setAttributes(array('id' => 'cpassword', 'class' => 'type_text_input')); $this->add($id_hidden); $this->add($email_text); $this->add($type_text); $this->add($password_text); $this->add($cpassword_text); }
public function getForm(array $default_status) { if (!$this->form) { $hidId = new Element\Hidden(); $hidId->setName('userId'); $txtName = new Element\Text(); $txtName->setLabel('User Name')->setName("userName")->setAttribute('class', 'form-control'); $password = new Element\Password(); $password->setLabel('Password')->setName('password')->setAttribute('class', 'form-control'); $confirmPassword = new Element\Password(); $confirmPassword->setName('confirmPassword')->setLabel('Retype Password')->setAttribute('class', 'form-control'); $selectRole = new Element\Hidden('userRole'); $description = new Element\Textarea(); $description->setName('description')->setLabel('Description')->setAttribute('class', 'form-control'); $status = new Element\Select(); $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($default_status); $image = new Element\File(); $image->setName('image')->setLabel('Profile image'); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->setAttribute('enctype', 'multipart/form-data'); $form->add($hidId); $form->add($txtName); $form->add($password); $form->add($confirmPassword); $form->add($selectRole); $form->add($description); $form->add($status); $form->add($image); $this->form = $form; } return $this->form; }
public function getForm(array $defaultStatus, array $currencyList) { if (!$this->form) { $positionId = new Element\Hidden(); $positionId->setName('positionId'); $name = new Element\Text(); $name->setLabel('Name')->setName("name")->setAttribute('class', 'form-control'); $minSalary = new Element\Text(); $minSalary->setLabel('MinSalary')->setName("min_Salary")->setAttribute('class', 'form-control'); $maxSalary = new Element\Text(); $maxSalary->setLabel('MaxSalary')->setName("max_Salary")->setAttribute('class', 'form-control'); $currency = new Element\Select(); $currency->setName('currencyId')->setLabel('Currency Type')->setAttribute('class', 'form-control')->setEmptyOption('-- Choose Currency --')->setValueOptions($currencyList); $status = new Element\Select(); $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($defaultStatus); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->add($positionId); $form->add($name); $form->add($currency); $form->add($minSalary); $form->add($maxSalary); $form->add($status); $this->form = $form; } return $this->form; }
/** * @outputBuffering disabled */ public function testCanRenderFieldsets() { $this->expectOutputRegex('/<form(.*)<fieldset(.*)<\\/fieldset>(.*)<fieldset(.*)<\\/fieldset>(.*)<\\/form>/'); $form = new NetsensiaForm(); $form->addHidden('test1', 'testvalue'); $hidden = new Element\Hidden('asdasd'); $hidden->setValue('123'); $form->add($hidden); $element1 = new Text('testelement1'); $element1->setLabel('Test Element'); $element1->setAttribute('icon', 'pencil'); $element2 = new Text('testelement2'); $element2->setLabel('Test Element 2'); $element2->setAttribute('icon', 'pencil'); $fieldset1 = new Fieldset('testfieldset1'); $fieldset1->add($element1); $fieldset2 = new Fieldset('testfieldset2'); $fieldset2->add($element2); $form->add($fieldset1); $form->add($fieldset2); $helpers = new HelperPluginManager(); $helpers->setService('formElement', new FormElement()); $view = new PhpRenderer(); $view->setHelperPluginManager($helpers); $viewHelper = new BootstrapForm(); $viewHelper->setView($view); $viewHelper($form, 'testform', '/'); }
public function testIgnoreLabelForHidden() { $element = new Element\Hidden('foo'); $element->setLabel('My label'); $markup = $this->helper->render($element); $this->assertEquals('<input type="hidden" name="foo" value=""/>', $markup); }
public function getForm() { if (!$this->form) { $hidId = new Element\Hidden(); $hidId->setName('routeId'); $txtName = new Element\Text(); $txtName->setLabel('Route Name')->setName("name")->setAttribute('class', 'form-control'); $txtRoute = new Element\Text(); $txtRoute->setLabel('Route')->setName("route")->setAttribute('class', 'form-control'); $txtModule = new Element\Text(); $txtModule->setLabel("Module")->setName('module')->setAttribute('class', 'form-control'); $txtController = new Element\Text(); $txtController->setLabel("Controller")->setName('controller')->setAttribute('class', 'form-control'); $txtConstraints = new Element\Textarea(); $txtConstraints->setLabel("Constraints")->setName('constraints')->setAttribute('class', 'form-control'); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->add($hidId); $form->add($txtName); $form->add($txtRoute); $form->add($txtModule); $form->add($txtController); $form->add($txtConstraints); $this->form = $form; } return $this->form; }
public function __construct($name = null) { parent::__construct('users'); $this->setAttribute('class', 'form-horizontal'); $this->setAttribute('method', 'post'); $this->setAttribute('id', 'changePasswordForm'); $this->setAttribute('novalidate', true); $this->setAttribute('autocomplete', false); $id = new Element\Hidden('id'); $id->setAttribute('class', 'primarykey'); $id->setAttribute('id', 'id'); $cpassword = new Element\Password('cpassword'); $cpassword->setLabel('Current Password')->setAttribute('class', 'required form-control')->setAttribute('id', 'cpassword')->setAttribute('placeholder', 'Current Password'); $password = new Element\Password('password'); $password->setLabel('New Password')->setAttribute('class', 'required form-control password_strength_check')->setAttribute('id', 'password')->setAttribute('placeholder', 'New Password'); $repassword = new Element\Password('repassword'); $repassword->setLabel('Re-type Password')->setAttribute('class', 'required form-control')->setAttribute('id', 'repassword')->setAttribute('placeholder', 'Re-type Password'); $submit = new Element\Submit('submit'); $submit->setValue('Change Password')->setAttribute('id', 'submit')->setAttribute('class', 'btn btn-lg btn-success btn-block'); $this->add($id); $this->add($cpassword); $this->add($password); $this->add($repassword); // $this->add($submit); }
public function __construct() { parent::__construct('page'); //Méthode d'envoie (GET,POST) $this->setAttribute('method', 'post'); //Définition des champs //Menu Page // $idField = new Element\Select('menu_id'); // $idField->setAttribute('class', 'browser-default'); // $idField->setLabel('Menu'); // $this->add($idField); $idField = new Element\Hidden('structure'); $idField->setAttribute('id', 'structureform'); $this->add($idField); $idField = new Element\Hidden('block_element'); $idField->setAttribute('id', 'block-element'); $this->add($idField); //Page Category $idField = new Element\Select('ctgr_id'); $idField->setAttribute('class', 'browser-default'); $idField->setLabel('Category'); $this->add($idField); //Page Title $titleField = new Element\Text('title'); $titleField->setLabel('Titre'); $this->add($titleField); //Page Content $contentField = new Element\Textarea('content'); $contentField->setLabel('Description'); $this->add($contentField); $submitField = new Element\Submit('submit'); $submitField->setValue('Envoyer'); $submitField->setAttributes(array('id' => 'submitbutton', 'class' => 'btn waves-effect waves-light btn-submit-form-page')); $this->add($submitField); }
public function getForm(array $staff) { if (!$this->form) { $attendanceId = new Element\Hidden(); $attendanceId->setName('attendanceId'); $staffId = new Element\Select(); $staffId->setName('staffId')->setLabel('Staff')->setAttribute('class', 'form-control')->setEmptyOption('-- Choose --')->setValueOptions($staff); $type = new Element\Select(); $type->setName('type')->setLabel('Type')->setAttribute('class', 'form-control')->setValueOptions(array('I' => 'In', 'O' => 'Out')); $date = new Element\Date(); $date->setName('attendanceDate')->setLabel('Date')->setAttributes(array('class' => 'form-control', 'allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD'))); $workingHours = array(); for ($i = 8; $i < 20; $i++) { $workingHours[$i] = sprintf('%02d', $i); } $hour = new Element\Select(); $hour->setName('hour')->setAttribute('class', 'form-control')->setValueOptions($workingHours); $workingMinutes = array(); for ($i = 0; $i < 12; $i++) { $workingMinutes[$i] = sprintf('%02d', $i * 5); } $minute = new Element\Select(); $minute->setName('minute')->setAttribute('class', 'form-control')->setValueOptions($workingMinutes); $form = new Form(); $form->setAttributes(array('role' => 'form', 'class' => 'form-horizontal')); $form->add($attendanceId); $form->add($staffId); $form->add($type); $form->add($date); $form->add($hour); $form->add($minute); $this->form = $form; } return $this->form; }
function __construct() { parent::__construct('console_address'); $element_id = new Element\Hidden('id'); $element_id->setValue(''); $this->add($element_id); $this->add(array('name' => 'username', 'type' => 'Text')); $this->add(array('name' => 'domain', 'type' => 'Text')); $this->add(array('name' => 'nickname', 'type' => 'Text')); $element_sex = new Element\Select('sex'); $element_sex->setValueOptions(array(self::ADDRESS_SEX_BOY => '男性', self::ADDRESS_SEX_GIRL => '女性')); $this->add($element_sex); $this->add(array('name' => 'submit', 'type' => 'Submit')); /** * Setting up inputFilter */ $input_id = new Input('id'); $input_id->setRequired(false)->getValidatorChain()->attach(new \Zend\Validator\StringLength(array('max' => 50)))->attach(new \Zend\Validator\Digits()); $input_username = new Input('username'); $input_username->setRequired(true)->getValidatorChain()->attach(new \Zend\Validator\StringLength(array('max' => 18)))->attach(new \Zend\Validator\Digits()); $input_filter = new InputFilter(); $input_filter->add($input_id); $input_filter->add($input_username); $this->setInputFilter($input_filter); }
private function addStep($index) { $stepIdElement = new Hidden('StepId' . $index); $stepIdElement->setValue($index); $this->add($stepIdElement); $quantityElement = new Text('StepQuantityValue' . $index); $quantityElement->setLabel('Menge'); $quantityElement->setAttribute('id', 'StepQuantityValue' . $index); $this->add($quantityElement); $units = $this->selectAllFrom('Units', 'Name'); $unitElement = new Select('StepUnit' . $index); $unitElement->setValueOptions($units); // need to set default value. otherwise null is saved. $unitElement->setValue(0); $unitElement->setAttribute('id', 'StepUnit' . $index); $this->add($unitElement); $ingredients = $this->selectAllFrom('Ingredients', 'Name'); $ingredientElement = new Select('StepIngredient' . $index); $ingredientElement->setValueOptions($ingredients); //just set any default value. inserting ingredients has to be workes out anyway $ingredientElement->setValue(0); $ingredientElement->setAttribute('id', 'StepIngredient' . $index); $this->add($ingredientElement); $textElement = new Textarea('StepText' . $index); $textElement->setAttribute('id', 'StepText' . $index); $this->add($textElement); }
public function getForm(array $companyTypes, array $statusList) { if (!$this->form) { $companyId = new Element\Hidden(); $companyId->setName('companyId'); $name = new Element\Text(); $name->setLabel('Name')->setName("name")->setAttribute('class', 'form-control'); $phone = new Element\Text(); $phone->setLabel('Phone')->setName("phone")->setAttribute('class', 'form-control'); $address = new Element\Textarea(); $address->setLabel('Address')->setName("address")->setAttribute('class', 'form-control'); $website = new Element\Url(); $website->setLabel('Website')->setName("website")->setAttribute('class', 'form-control'); $type = new Element\Select(); $type->setName("type")->setLabel('Type')->setAttribute('class', 'form-control')->setValueOptions($companyTypes); $status = new Element\Select(); $status->setName("status")->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($statusList); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->add($companyId); $form->add($name); $form->add($phone); $form->add($address); $form->add($website); $form->add($type); $form->add($status); $this->form = $form; } return $this->form; }
/** * @param $which * @return $this */ public function setWhich($which) { $hidden = new Form\Element\Hidden('which'); $hidden->setLabel(' '); $hidden->setValue($which); $this->add($hidden); return $this; }
public function getTemplate(PhpRenderer $view) { // Normalize vocab terms for use in a select element. $terms = array_map('trim', explode(PHP_EOL, $this->vocab->terms())); $valueOptions = array_combine($terms, $terms); $hidden = new Hidden('customvocab'); $hidden->setAttributes(['class' => 'language'])->setValue($this->vocab->lang()); $select = new Select('customvocab'); $select->setAttributes(['class' => 'terms'])->setEmptyOption('Select Below')->setValueOptions($valueOptions); return $view->formHidden($hidden) . $view->formSelect($select); }
public function getHiddenElement(ElementInterface $element) { if ($element instanceof Hidden) { return $element; } $name = $element->getName(); $value = $element->getValue(); $hidden = new Hidden($name); $hidden->setValue($value); return $hidden; }
public function __construct($name = null) { parent::__construct('page'); $id_hidden = new Element\Hidden('id'); $id_hidden->setName('id'); $title_text = new Element\Text('title'); $title_text->setLabel('Title'); $title_text->setLabelAttributes(array('class' => 'type_text type_text_short')); $title_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => 'require')); $url_text = new Element\Text('url'); $url_text->setLabel('Url'); $url_text->setLabelAttributes(array('class' => 'type_text type_text_short')); $url_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => 'require')); $text_textarea = new Element\Textarea('text'); $text_textarea->setLabel('Text'); $text_textarea->setLabelAttributes(array('class' => 'type_text')); $text_textarea->setAttributes(array('placeholder' => 'Type something...')); $auto_check = new Element\Checkbox('auto'); $auto_check->setLabel('Automatically'); $auto_check->setLabelAttributes(array('class' => 'type_text type_check')); $auto_check->setUseHiddenElement(true); $auto_check->setCheckedValue("1"); $auto_check->setUncheckedValue("0"); $auto_check->setValue('1'); $meta_text = new Element\Text('meta'); $meta_text->setLabel('Meta'); $meta_text->setLabelAttributes(array('class' => 'type_text type_text_mod_darker')); $meta_text->setAttributes(array('class' => 'type_text_input')); $keywords_text = new Element\Text('keywords'); $keywords_text->setLabel('Keywords'); $keywords_text->setLabelAttributes(array('class' => 'type_text type_text_mod_darker')); $keywords_text->setAttributes(array('class' => 'type_text_input')); $desc_text = new Element\Text('description'); $desc_text->setLabel('Description'); $desc_text->setLabelAttributes(array('class' => 'type_text type_text_mod_darker')); $desc_text->setAttributes(array('class' => 'type_text_input')); $submit_button = new Element\Submit('submit'); $submit_button->setValue('Submit'); $submit_button->setAttributes(array('class' => 'btn btn_white')); $cancel_button = new Element\Submit('cancel'); $cancel_button->setValue('Cancel'); $cancel_button->setAttributes(array('class' => 'btn btn_rozy')); $this->add($id_hidden); $this->add($title_text); $this->add($url_text); $this->add($text_textarea); $this->add($auto_check); $this->add($meta_text); $this->add($keywords_text); $this->add($desc_text); $this->add($submit_button); $this->add($cancel_button); }
public function __construct(EntityManager $em) { parent::__construct(); $this->em = $em; $hiddenElement = new Element\Hidden('id'); $hiddenElement->setName('id')->setAttributes(array('type' => 'hidden')); $this->add($hiddenElement, array()); $this->add(array('name' => 'name', 'options' => array('label' => 'Category Name'), 'attributes' => array('type' => 'text', 'placeholder' => 'Category Name', 'class' => 'form-control', 'id' => 'name', 'required' => 'required', 'autofocus' => 'autofocus')))->add(array('type' => 'Zend\\Form\\Element\\Csrf', 'name' => 'csrf')); $submitElement = new Element\Button('submit'); $submitElement->setName('submit')->setLabel('Save Category')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-primary btn-sm', 'id' => 'addCategory')); $this->add($submitElement, array('priority' => -100)); }
public function __construct($name = null, $options = array()) { parent::__construct(isset($name) ? $name : 'personal'); $id_hidden = new Element\Hidden('id'); $id_hidden->setName('id'); $firstname_text = new Element\Text('firstname'); $firstname_text->setLabel('First name'); $firstname_text->setLabelAttributes(array('class' => 'type_text')); $firstname_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...')); $lastname_text = new Element\Text('lastname'); $lastname_text->setLabel('Last name'); $lastname_text->setLabelAttributes(array('class' => 'type_text')); $lastname_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => true)); $country_select = new Element\Select('country_id'); $country_select->setLabel('Country'); $country_select->setLabelAttributes(array('class' => 'select f_3_w50')); $country_select->setAttributes(array('class' => 'sel_chosen')); $country_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your country')); $state_select = new Element\Select('state_id'); $state_select->setLabel('Province/State'); $state_select->setLabelAttributes(array('class' => 'select f_3_w50')); $state_select->setAttributes(array('class' => 'sel_chosen', 'required' => true)); $state_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your state')); $city_select = new Element\Select('city_id'); $city_select->setLabel('City'); $city_select->setLabelAttributes(array('class' => 'select f_3_w50')); $city_select->setAttributes(array('class' => 'sel_chosen', 'required' => true)); $city_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your city')); $adress_text = new Element\Text('adress'); $adress_text->setLabel('Adress'); $adress_text->setLabelAttributes(array('class' => 'type_text')); $adress_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type adress in format (наш формат)')); $languages_select = new Element\Select('languages'); $languages_select->setLabel('Languages'); $languages_select->setLabelAttributes(array('class' => 'select', 'style' => 'float:left;')); $languages_select->setAttributes(array('class' => 'sel_chosen', 'multiple' => 'multiple', 'required' => true)); $languages_select->setOptions(array('disable_inarray_validator' => true)); $logo = new Element\Image('logo'); $logo->setAttributes(array('src', '/images/11.jpg', 'style' => 'float:left;')); $file = new Element\File('file'); $file->setLabelAttributes(array('style' => 'float:left;clear:both')); $this->add($id_hidden); $this->add($firstname_text); $this->add($lastname_text); $this->add($country_select); $this->add($state_select); $this->add($city_select); $this->add($adress_text); $this->add($languages_select); $this->add($logo); $this->add($file); }
public function init() { $this->setName('album'); $id = new Element\Hidden('id'); $id->addFilter('Int'); $artist = new Element\Text('artist'); $artist->setLabel('Artist')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $title = new Element\Text('title'); $title->setLabel('Title')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $submit = new Element\Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $this->addElements(array($id, $artist, $title, $submit)); }
public function __construct($name = null) { parent::__construct('menu'); $this->setAttribute('method', 'post'); $this->setAttribute('id', 'postmenu'); //Menu Name $titleField = new Element\Text('menu_name'); $titleField->setLabel('Menu Name'); $this->add($titleField); $idField = new Element\Hidden('order'); $idField->setAttribute('id', 'order'); $this->add($idField); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Envoyer', 'id' => 'submitbuttonmenu', 'class' => 'btn waves-effect waves-light'))); }
/** * {@inheritDoc} */ public function form(PhpRenderer $view, array $options = []) { $titleInput = new TextInput('o:media[__index__][dcterms:title][0][@value]'); $titlePropertyInput = new Hidden('o:media[__index__][dcterms:title][0][property_id]'); //make sure we have correct dcterms:title id $api = $view->api(); $dctermsTitle = $api->search('properties', ['term' => 'dcterms:title'])->getContent()[0]; $titlePropertyInput->setValue($dctermsTitle->id()); $titleInput->setOptions(['label' => $view->translate('Title'), 'info' => $view->translate('A title for the HTML content')]); $html = $view->formRow($titleInput); $html .= $view->formRow($titlePropertyInput); $html .= $this->getForm($view, 'media-html-__index__'); return $html; }
public function getForm(array $currencies, array $companies, array $contacts, array $statusList) { if (!$this->form) { $hidId = new Element\Hidden(); $hidId->setName('proposalId'); $txtCompanyId = new Element\Select(); $txtCompanyId->setLabel('Company Name')->setName("companyId")->setAttribute('class', 'form-control')->setEmptyOption("--Choose Company--")->setValueOptions($companies); $txtContactId = new Element\Select(); $txtContactId->setLabel('Contact Name')->setName('contactId')->setAttribute('class', 'form-control')->setEmptyOption("--Choose Contact--")->setValueOptions($contacts); $txtCode = new Element\Text(); $txtCode->setLabel('Code')->setName('code')->setAttribute('class', 'form-control'); $txtName = new Element\Text(); $txtName->setLabel('Name')->setName('name')->setAttribute('class', 'form-control'); $txtAmount = new Element\Number(); $txtAmount->setName("amount")->setLabel('Amount')->setAttribute('class', 'form-control')->setAttributes(array('min' => '100', 'max' => '99999999999', 'step' => '100')); $selectCurrency = new Element\Select(); $selectCurrency->setName('currencyId')->setLabel('Currency')->setAttribute('class', 'form-control')->setValueOptions($currencies); $txtProposalDate = new Element\Date('proposalDate'); $txtProposalDate->setLabel('Date')->setAttributes(array('class' => 'form-control', 'allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD'))); $txtProposalFile = new Element\File(); $txtProposalFile->setName('proposalFile')->setLabel('Upload file'); $txtNodes = new Element\Textarea(); $txtNodes->setLabel('Notes')->setName('notes')->setAttribute('class', 'form-control'); $txtProposalBy = new Element\Text(); $txtProposalBy->setName('proposalBy')->setLabel('Proposal By')->setAttribute('class', 'form-control'); $txtGroupCode = new Element\Text(); $txtGroupCode->setLabel('Group Code')->setName('group_code')->setAttribute('class', 'form-control'); $txtStatus = new Element\Select(); $txtStatus->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($statusList); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->setAttribute('enctype', 'multipart/form-data'); $form->add($hidId); $form->add($txtCompanyId); $form->add($txtContactId); $form->add($txtCode); $form->add($txtName); $form->add($txtAmount); $form->add($selectCurrency); $form->add($txtProposalDate); $form->add($txtProposalFile); $form->add($txtNodes); $form->add($txtProposalBy); $form->add($txtGroupCode); $form->add($txtStatus); $this->form = $form; } return $this->form; }
public function __construct($name = null) { parent::__construct('users'); $this->setAttribute('class', ''); $this->setAttribute('method', 'post'); $id = new Element\Hidden('id'); $id->setAttribute('class', 'primarykey'); $email_check_code = new Element\Text('email_check_code'); $email_check_code->setLabel('Email Check Code')->setAttribute('class', 'required')->setAttribute('placeholder', 'Confirmation Code'); $submit = new Element\Submit('submit'); $submit->setValue('Submit')->setAttribute('class', 'btn btn-success btn-hossbrag pad-left-35 pad-right-35'); $this->add($id); $this->add($email_check_code); $this->add($submit); }
public function __construct(EntityManager $em) { parent::__construct(); $this->em = $em; $hiddenElement = new Element\Hidden('id'); $hiddenElement->setName('id')->setAttributes(array('type' => 'hidden')); $this->add($hiddenElement, array()); $this->add(array('name' => 'name', 'options' => array('label' => 'Product Name'), 'attributes' => array('type' => 'text', 'placeholder' => 'Product Name', 'class' => 'form-control', 'id' => 'name', 'required' => 'required', 'autofocus' => 'autofocus')))->add(array('name' => 'sku', 'options' => array('label' => 'SKU'), 'attributes' => array('type' => 'text', 'placeholder' => 'SKU', 'class' => 'form-control', 'id' => 'sku', 'required' => 'required')))->add(array('name' => 'price', 'options' => array('label' => 'Product Price', 'help' => 'Price must be of type float i.e 50.00'), 'attributes' => array('type' => 'text', 'placeholder' => 'Product Price', 'class' => 'form-control', 'id' => 'price', 'required' => 'required')))->add(array('type' => 'Zend\\Form\\Element\\Number', 'name' => 'qty', 'options' => array('label' => 'Qty in Stock'), 'attributes' => array('min' => '0', 'step' => '1', 'placeholder' => 'Qty in Stock', 'class' => 'form-control', 'id' => 'qty', 'required' => 'required')))->add(array('type' => 'Zend\\Form\\Element\\Csrf', 'name' => 'csrf')); $textAreaElement = new Element\Textarea('description'); $textAreaElement->setName('description')->setLabel('Product Description')->setAttributes(array('type' => 'textarea', 'placeholder' => 'Product Description', 'class' => 'form-control', 'rows' => '3', 'id' => 'description', 'required' => 'required')); $this->add($textAreaElement, array()); $submitElement = new Element\Button('submit'); $submitElement->setName('submit')->setLabel('Save Product')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-primary btn-sm', 'id' => 'addProduct')); $this->add($submitElement, array('priority' => -100)); }
public function __construct(OrmCongregacao $orm = null) { parent::__construct("formProduto"); $txtId = new Element\Hidden("id"); $txtNome = new Element\Text("nome"); $txtNome->setAttributes(array('class' => 'form-control', 'placeholder' => 'Nome da Congregação', 'data-parsley-trigger' => 'change', 'pattern' => '^[aA-zZ]+((\\s[aA-zZ]+)+)?$', 'required' => 'true')); $txtCep = new Element\Text("cep"); $txtCep->setAttributes(array('class' => 'form-control', 'placeholder' => 'XXXXXXXX', 'data-parsley-trigger' => 'change', 'pattern' => '/^[0-9]{2}[0-9]{3}[0-9]{3}$/', 'max-length' => '8', 'required' => 'true')); $txtNumero = new Element\Text("numero"); $txtNumero->setAttributes(array('class' => 'form-control', 'placeholder' => 'Numero', 'data-parsley-trigger' => 'change', 'pattern' => '/^[0-9]+$/', 'max-length' => '6', 'required' => 'true')); $txtLogradouro = new Element\Text("logradouro"); $txtLogradouro->setAttributes(array('class' => 'form-control', 'placeholder' => 'Ex: Rua, Avenida, Travessa...', 'required' => 'true')); $txtBairro = new Element\Text("bairro"); $txtBairro->setAttributes(array('class' => 'form-control', 'required' => 'true')); $txtCidade = new Element\Text("cidade"); $txtCidade->setAttributes(array('class' => 'form-control', 'required' => 'true')); $txtUf = new Element\Text("uf"); $txtUf->setAttributes(array('class' => 'form-control', 'max-length' => '2', 'required' => 'true')); $iToken = new Element\Csrf("iToken"); $btnSalvar = new Element\Button('salvar'); $btnSalvar->setAttributes(array('class' => 'btn btn-darkgray btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); $btnVoltar = new Element\Button('voltar'); $btnVoltar->setAttributes(array('class' => 'btn btn-blue btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); if ($orm != null) { $txtId->setValue($orm->getId()); $txtNome->setValue($orm->getNome()); $txtCep->setValue($orm->getCep()); $txtNumero->setValue($orm->getNumero()); $txtLogradouro->setValue($orm->getLogradouro()); $txtBairro->setValue($orm->getBairro()); $txtCidade->setValue($orm->getCidade()); $txtUf->setValue($orm->getUf()); } // $this->add($txtId); $this->add($txtNome); $this->add($txtCep); $this->add($txtNumero); $this->add($txtLogradouro); $this->add($txtBairro); $this->add($txtCidade); $this->add($txtUf); $this->add($iToken); $this->add($btnSalvar); $this->add($btnVoltar); $this->setAttributes(array('id' => 'form', 'data-parsley-validate' => NULL)); }
public function getForm(array $usersData, array $positionsData, array $currencyData, array $defaultStatus) { if (!$this->form) { $hidId = new Element\Hidden(); $hidId->setName('staffId'); $selectUsers = new Element\Select(); $selectUsers->setName('userId')->setLabel('User')->setAttribute('class', 'form-control')->setEmptyOption("--Choose User --")->setValueOptions($usersData); $staffCode = new Element\Text(); $staffCode->setLabel('Code')->setName("staffCode")->setAttribute('class', 'form-control'); $staffName = new Element\Text(); $staffName->setLabel('Name')->setName("staffName")->setAttribute('class', 'form-control'); $selectPosition = new Element\Select(); $selectPosition->setName('positionId')->setLabel('Position')->setAttribute('class', 'form-control')->setEmptyOption("-- Choose Position --")->setValueOptions($positionsData); $selectDepartment = new Element\Hidden('departmentId'); $salary = new Element\Number(); $salary->setLabel('Salary')->setName("salary")->setAttributes(array('min' => '0', 'max' => '999999999999', 'step' => '1')); $leave = new Element\Number(); $leave->setLabel('Leave')->setName("annual_leave")->setAttributes(array('min' => '0.5', 'max' => '100', 'step' => '0.5')); $PermanentDate = new Element\Date('permanentDate'); $PermanentDate->setLabel('P-Date')->setAttributes(array('allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD'))); $birthDay = new Element\Date('birthday'); $birthDay->setLabel('Birthday')->setAttributes(array('allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD'))); $selectCurrency = new Element\Select(); $selectCurrency->setName('currencyId')->setAttribute('class', 'form-control')->setValueOptions($currencyData); $status = new Element\Select(); $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($defaultStatus); $bankCode = new Element\Text('bankCode'); $bankCode->setLabel('Bank Account')->setAttributes(array('class' => 'form-control', 'placeholder' => 'Aya Bank Account No')); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->add($hidId); $form->add($selectUsers); $form->add($staffCode); $form->add($staffName); $form->add($selectPosition); $form->add($selectDepartment); $form->add($salary); $form->add($leave); $form->add($PermanentDate); $form->add($status); $form->add($birthDay); $form->add($selectCurrency); $form->add($bankCode); $this->form = $form; } return $this->form; }
public function __construct($name = null) { parent::__construct('resources'); $this->setAttribute('class', 'form-horizontal'); $this->setAttribute('method', 'post'); $id = new Element\Hidden('id'); $id->setAttribute('class', 'primarykey'); $name = new Element\Text('name'); $name->setLabel('Name')->setAttribute('class', 'required form-control')->setAttribute('id', 'name')->setAttribute('readonly', 'readonly')->setAttribute('placeholder', 'Name'); $title = new Element\Text('title'); $title->setLabel('Title')->setAttribute('class', 'required form-control')->setAttribute('id', 'title')->setAttribute('placeholder', 'Title'); $submit = new Element\Submit('submit'); $submit->setValue('Submit')->setAttribute('class', 'btn btn-success'); $this->add($id); $this->add($name); $this->add($title); }