public function __construct($sm) { parent::__construct('GTEventSearch'); $element = new Text(); $element->setName('GTEventData')->setAttribute('class', 'form-control')->setLabel('Error search')->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $this->add($element); }
public function __construct() { parent::__construct(); $this->setAttribute('method', 'post')->setAttribute('action', '/user/register')->setAttribute('id', 'user-register-form'); $email = new Email(); $email->setName('email')->setLabel('Email Address'); $userName = new Text(); $userName->setName('userName')->setLabel('Username'); $password = new Password(); $password->setName('password')->setLabel('Password'); $firstName = new Text(); $firstName->setName('firstName')->setLabel('First Name'); $lastName = new Text(); $lastName->setName('lastName')->setLabel('Last Name'); $csrf = new Csrf(); $csrf->setName('prev'); $submit = new Submit(); $submit->setName('submit')->setValue('Register'); $this->add($email)->add($userName)->add($password)->add($firstName)->add($lastName)->add($csrf)->add($submit); foreach ($this->elements as $element) { if (!$element instanceof Submit) { $element->setAttribute('class', 'form-control'); } } }
public function addElements() { $id = new Element\Hidden('id'); $title = new Element\Text('title'); $description = new Element\Textarea('description'); $postDate = new Element\Hidden('post_date'); $submit = new Element\Submit('submit'); $title->setName('title')->setAttributes(['placeholder' => 'Título', 'size' => 41])->setLabel('Título')->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $description->setName('description')->setAttributes(['placeholder' => 'Digite o conteúdo', 'rows' => 10, 'cols' => 40])->setLabel('Conteúdo')->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $submit->setAttribute('value', 'Salvar')->setAttribute('class', 'btn btn-info'); $this->add($id)->add($title)->add($description)->add($postDate)->add($submit); }
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 addElements() { $id = new Element\Hidden('id'); $postsId = new Element\Select('postsId'); $description = new Element\Text('description'); $name = new Element\Text('name'); $email = new Element\Email('email'); $webpage = new Element\Text('webpage'); $commentDate = new Element\Hidden('commentDate'); $submit = new Element\Submit('submit'); $description->setName('description')->setAttribute('placeholder', 'Digite o seu comentário')->setLabel('Comentário')->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $postsId->setName('postsId')->setLabel('Post')->setLabelAttributes(array('class' => 'col-sm-2 control-label'))->setEmptyOption('Escolha um post'); $name->setName('name')->setAttribute('placeholder', 'Nome')->setLabel('Nome')->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $email->setName('email')->setAttribute('placeholder', 'E-mail')->setLabel('E-mail')->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $webpage->setName('webpage')->setAttribute('placeholder', 'Web page')->setLabel('Web page')->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $submit->setAttribute('value', 'Salvar')->setAttribute('class', 'btn btn-info'); $this->add($id)->add($postsId)->add($description)->add($name)->add($email)->add($commentDate)->add($webpage)->add($submit); }
public function addElements() { $this->setAttributes(array('method' => 'post', 'class' => 'form-horizontal', 'action' => '/admin/users/save')); $usrId = new Element\Hidden('usr_id'); $name = new Element\Text('name'); $name->setName('name')->setAttribute('placeholder', 'Nome do usuário')->setLabel('Nome do usuário')->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $username = new Element\Text('username'); $username->setName('username')->setAttributes(array('id' => 'username', 'placeholder' => 'Usuário'))->setLabel('Usuário')->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $password = new Element\Password('password'); $password->setName('password')->setAttributes(array('id' => 'password', 'placeholder' => 'Senha'))->setLabel('Senha')->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $role = new Element\Select('role'); $role->setName('role')->setLabel('Perfil de usuário')->setLabelAttributes(array('class' => 'col-sm-2 control-label'))->setValueOptions(array('' => 'Escolha um perfil', 'admin' => 'Administrador', 'redator' => 'Redator')); $valid = new Element\Checkbox('valid'); $valid->setName('valid')->setLabel('Ativar usuário')->setLabelAttributes(array('class' => 'lbl')); $submit = new Element\Submit('submit'); $submit->setAttribute('value', 'Salvar')->setAttribute('class', 'btn btn-primary'); $this->add($usrId)->add($name)->add($username)->add($password)->add($role)->add($valid)->add($submit); }
public function __construct() { parent::__construct(); $this->setAttribute('method', 'post'); $this->setAttribute('action', '/user/dashboard/post/create'); $this->setAttribute('id', 'user-post-form'); $title = new Text(); $title->setName('title')->setLabel('Title')->setAttribute('required', 'true'); $body = new Textarea(); $body->setName('body')->setAttributes(array('placeholder' => 'Your post content...', 'rows' => 8, 'resizable' => 'false', 'required' => 'true')); $csrf = new Csrf(); $csrf->setName('prev'); $submit = new Submit(); $submit->setName('submit')->setValue('Create')->setAttribute('class', 'btn btn-info'); $this->add($title)->add($body)->add($csrf)->add($submit); foreach ($this->elements as $element) { if (!$element instanceof Submit) { $element->setAttribute('class', 'form-control'); } } }
public function getForm(array $holidayType) { if (!$this->form) { $hidId = new Hidden(); $hidId->setName('calendarId'); $cboType = new Select(); $cboType->setName('type')->setLabel('Type')->setAttribute('class', 'form-control')->setEmptyOption('-- Choose Types --')->setValueOptions($holidayType); $maxYear = date('Y', time()) + 10; $datePicker = new DateSelect('date'); $datePicker->setValue(new \DateTime('now'))->setShouldRenderDelimiters(false)->setMinYear(2011)->setMaxYear($maxYear)->setLabel('Date')->setDayAttributes(array('class' => 'date-control', 'id' => 'dayCombo'))->setMonthAttributes(array('class' => 'date-control', 'id' => 'monthCombo'))->setYearAttributes(array('class' => 'date-control', 'id' => 'yearCombo')); $txtTitle = new Text(); $txtTitle->setName('title')->setLabel('Title')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'Title'); $form = new Form(); $form->setAttributes(array('class' => 'form-horizontal', 'role' => 'form')); $form->add($hidId); $form->add($cboType); $form->add($datePicker); $form->add($txtTitle); $this->form = $form; } return $this->form; }
public function getForm(array $currencies) { if (!$this->form) { $hidId = new Element\Hidden(); $hidId->setName('receiveVoucherId'); $txtVoucherNo = new Element\Text(); $txtVoucherNo->setLabel('Number')->setName("voucherNo")->setAttribute('class', 'form-control text-center')->setAttribute('readonly', 'readonly'); $txtVoucherDate = new Element\Date('voucherDate'); $txtVoucherDate->setLabel('Date')->setAttributes(array('class' => 'form-control', 'allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD'))); $txtAccountType = new Element\Hidden('accountType'); $txtDescription = new Element\Textarea(); $txtDescription->setName("description")->setLabel('Description')->setAttribute('class', 'form-control'); $txtAmount = new Element\Number(); $txtAmount->setName("amount")->setLabel('Amount')->setAttribute('class', 'form-control')->setattributes(array('min' => '10', 'max' => '99999999999', 'step' => '1')); $cboCurrency = new Element\Select(); $cboCurrency->setName('currencyId')->setLabel('Currency Type')->setAttribute('class', 'form-control')->setEmptyOption('-- Choose --')->setValueOptions($currencies); $txtDepositBy = new Element\Hidden(); $txtDepositBy->setName("depositBy"); $txtReason = new Element\Textarea(); $txtReason->setName('reason'); $txtGroupCode = new Element\Text(); $txtGroupCode->setName('group_code')->setLabel('Group Code (optional)')->setAttribute('class', 'form-control'); $form = new Form(); $form->setAttribute('role', 'form'); $form->add($hidId); $form->add($txtVoucherNo); $form->add($txtVoucherDate); $form->add($txtAccountType); $form->add($txtDescription); $form->add($txtAmount); $form->add($cboCurrency); $form->add($txtDepositBy); $form->add($txtReason); $form->add($txtGroupCode); $this->form = $form; } return $this->form; }
public function __construct() { parent::__construct(); $this->setAttribute('method', 'post'); $this->setAttribute('action', '/user/dashboard/messages/create'); $this->setAttribute('class', 'form-horizontal'); $this->setAttribute('id', 'user-message-form'); $to = new Text(); $to->setName('recipient')->setLabel('Recipients')->setAttribute('id', 'recipients'); $subject = new Text(); $subject->setName('subject')->setLabel('Subject'); $body = new Textarea(); $body->setName('body')->setAttributes(array('placeholder' => 'Your message...', 'rows' => 4)); $csrf = new Csrf(); $csrf->setName('prev'); $submit = new Submit(); $submit->setName('submit')->setValue('Send'); $this->add($to)->add($subject)->add($body)->add($csrf)->add($submit); foreach ($this->elements as $element) { if (!$element instanceof Submit) { $element->setAttribute('class', 'form-control'); } } }
public function __construct($name = null) { parent::__construct('create-cliente'); //nome $nome = new Text(); $nome->setName("name"); $nome->setAttribute('placeholder', 'Nome'); $nome->setAttribute('class', 'form-control'); $this->add($nome); //cognome $cognome = new Text(); $cognome->setName("cognome"); $cognome->setAttribute('placeholder', 'Cognome'); $cognome->setAttribute('class', 'form-control'); $this->add($cognome); //email $email = new Text(); $email->setName("email"); $email->setAttribute('placeholder', 'email'); $email->setAttribute('class', 'form-control'); $this->add($email); // numero di telefono $num = new Text(); $num->setName("num"); $num->setAttribute('placeholder', 'Numero di telefono'); $num->setAttribute('class', 'form-control'); $this->add($num); //bottone $btn = new Submit(); $btn->setName("submit"); $btn->setAttribute('value', 'go'); $btn->setAttribute('id', 'submitbutton'); $btn->setAttribute('class', 'btn btn-primary'); $this->add($btn); $this->setInputFilter($this->createInputFilter()); }
public function getForm(array $staffList, array $statusList, array $leaveList, $formType = 'W') { if (!$this->form) { $leaveId = new Element\Hidden('leaveId'); $staff = new Element\Select(); $staff->setName('staffId')->setEmptyOption('-- Choose Staff --')->setLabel('Staff')->setAttribute('class', 'form-control')->setValueOptions($staffList); $leaveType = new Element\Select(); $leaveType->setName('leaveType')->setLabel('Type')->setAttribute('class', 'form-control')->setValueOptions($leaveList); $date = new Element\Date(); $date->setName('date')->setLabel('Date')->setAttributes(array('allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD'))); $description = new Element\Textarea('description'); $description->setLabel('Description')->setAttribute('class', 'form-control'); $status = new Element\Select(); $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($statusList); if ($formType == 'R' || $formType == 'V') { $staff->setAttribute('disabled', 'disabled'); $leaveType->setAttribute('disabled', 'disabled'); $description->setAttribute('readonly', 'readonly'); } if ($formType == 'V') { $status->setAttribute('disabled', 'disabled'); $date = new Element\Text(); $date->setName('date')->setLabel('Date')->setattributes(array('class' => 'form-control', 'disabled' => 'disabled')); } $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->add($leaveId); $form->add($staff); $form->add($leaveType); $form->add($date); $form->add($description); $form->add($status); $this->form = $form; } return $this->form; }
/** * Load mixed prevalue editor * * @return string */ public function load() { $config = $this->getConfig(); $listDir = $this->getDatatype()->getDatatypesList(); $options = array(); foreach ($listDir as $dir) { $options[$dir] = $dir; } $datatypes = empty($config['datatypes']) ? array() : $config['datatypes']; foreach ($datatypes as $datatypeId => $datatypeConfig) { //Get datatypes $object = $this->loadDatatype($datatypeConfig['name']); //Force configuration $object->getPrevalueEditor()->setConfig(empty($datatypeConfig['config']) ? null : serialize($datatypeConfig['config'])); //Initiliaze prefix $prefix = 'datatypes[' . $datatypeId . ']'; //Create form $fieldset = new Fieldset(); $hidden = new Element\Hidden(); $hidden->setName($prefix . '[name]'); $hidden->setValue($datatypeConfig['name']); $fieldset->add($hidden); $label = new Element\Text(); $label->setName($prefix . '[label]'); $label->setAttribute('class', 'form-control'); $label->setLabel('Label'); $label->setAttribute('id', 'label' . $datatypeId); $label->setValue(empty($datatypeConfig['label']) ? '' : $datatypeConfig['label']); $fieldset->add($label); AbstractForm::addContent($fieldset, $object->getPrevalueEditor()->load(), $prefix); $datatypes[$datatypeId]['fieldset'] = $fieldset; } $data = array(); $data['datatypes'] = $datatypes; $data['modelOptions'] = $options; return $this->addPath(__DIR__)->render('mixed-prevalue.phtml', $data); }
public function render($formPV, $id) { $form = new Form(); $form->setAttribute('id', $id); $inputFilter = new \Zend\InputFilter\InputFilter(); $factory = new InputFactory(); foreach ($formPV as $element) { if (isset($element->line_text)) { $attributes = $element->line_text[0]; $name = isset($attributes->name) ? $attributes->name : ''; $type = isset($attributes->type) ? $attributes->type : ''; $position = isset($attributes->order) ? $attributes->order : ''; $placeholder = isset($attributes->data->placeholder) ? $attributes->data->placeholder : ''; $label = isset($attributes->data->label) ? $attributes->data->label : ''; //$required = ($attributes->data->required == 'true') ? true : false ; $required = false; $class = isset($attributes->data->class) ? $attributes->data->class : ''; $id = isset($attributes->data->id) ? $attributes->data->id : ''; $lengthMin = isset($attributes->data->length) ? $attributes->data->length->min : ''; $lengthMax = isset($attributes->data->length) ? $attributes->data->length->max : ''; $element = new Element\Text($name); $element->setName($label); $element->setLabel($label); $element->setAttributes(array('placeholder' => $placeholder, 'required' => $required, 'class' => $class, 'id' => $id)); $form->add($element); $options = array(); $options['encoding'] = 'UTF-8'; if ($lengthMin && $lengthMin > 0) { $options['min'] = $lengthMin; } if ($lengthMax && $lengthMax > $lengthMin) { $options['max'] = $lengthMax; $element->setAttribute('maxlength', $lengthMax); $options['messages'] = array(\Zend\Validator\StringLength::TOO_LONG => sprintf($this->getServiceManager()->get('translator')->translate('This field contains more than %s characters', 'playgroundgame'), $lengthMax)); } $inputFilter->add($factory->createInput(array('name' => $name, 'required' => $required, 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'StringLength', 'options' => $options))))); } if (isset($element->line_email)) { $attributes = $element->line_email[0]; $name = isset($attributes->name) ? $attributes->name : ''; $type = isset($attributes->type) ? $attributes->type : ''; $position = isset($attributes->order) ? $attributes->order : ''; $placeholder = isset($attributes->data->placeholder) ? $attributes->data->placeholder : ''; $label = isset($attributes->data->label) ? $attributes->data->label : ''; //$required = ($attributes->data->required == 'true') ? true : false ; $required = false; $class = isset($attributes->data->class) ? $attributes->data->class : ''; $id = isset($attributes->data->id) ? $attributes->data->id : ''; $lengthMin = isset($attributes->data->length) ? $attributes->data->length->min : ''; $lengthMax = isset($attributes->data->length) ? $attributes->data->length->max : ''; $element = new Element\Email($name); $element->setLabel($label); $element->setName($label); $element->setAttributes(array('placeholder' => $placeholder, 'required' => $required, 'class' => $class, 'id' => $id)); $form->add($element); $options = array(); $options['encoding'] = 'UTF-8'; if ($lengthMin && $lengthMin > 0) { $options['min'] = $lengthMin; } if ($lengthMax && $lengthMax > $lengthMin) { $options['max'] = $lengthMax; $element->setAttribute('maxlength', $lengthMax); $options['messages'] = array(\Zend\Validator\StringLength::TOO_LONG => sprintf($this->getServiceManager()->get('translator')->translate('This field contains more than %s characters', 'playgroundgame'), $lengthMax)); } $inputFilter->add($factory->createInput(array('name' => $name, 'required' => $required, 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'StringLength', 'options' => $options))))); } if (isset($element->line_checkbox)) { $attributes = $element->line_checkbox[0]; $name = isset($attributes->name) ? $attributes->name : ''; $type = isset($attributes->type) ? $attributes->type : ''; $position = isset($attributes->order) ? $attributes->order : ''; $label = isset($attributes->data->label) ? $attributes->data->label : ''; // $required = ($attributes->data->required == 'yes') ? true : false; $required = false; $class = isset($attributes->data->class) ? $attributes->data->class : ''; $id = isset($attributes->data->id) ? $attributes->data->id : ''; $lengthMin = isset($attributes->data->length) ? $attributes->data->length->min : ''; $lengthMax = isset($attributes->data->length) ? $attributes->data->length->max : ''; $innerData = isset($attributes->data->innerData) ? $attributes->data->innerData : array(); $element = new Element\MultiCheckbox($name); $element->setLabel($label); $element->setName($label); $element->setAttributes(array('name' => $name, 'required' => $required, 'allowEmpty' => !$required, 'class' => $class, 'id' => $id)); $values = array(); foreach ($innerData as $value) { $values[] = $value->label; } $element->setValueOptions($values); $form->add($element); $options = array(); $options['encoding'] = 'UTF-8'; $inputFilter->add($factory->createInput(array('name' => $name, 'required' => $required, 'allowEmpty' => !$required))); } if (isset($element->line_paragraph)) { $attributes = $element->line_paragraph[0]; $name = isset($attributes->name) ? $attributes->name : ''; $type = isset($attributes->type) ? $attributes->type : ''; $position = isset($attributes->order) ? $attributes->order : ''; $placeholder = isset($attributes->data->placeholder) ? $attributes->data->placeholder : ''; $label = isset($attributes->data->label) ? $attributes->data->label : ''; $required = $attributes->data->required == 'true' ? true : false; $class = isset($attributes->data->class) ? $attributes->data->class : ''; $id = isset($attributes->data->id) ? $attributes->data->id : ''; $lengthMin = isset($attributes->data->length) ? $attributes->data->length->min : ''; $lengthMax = isset($attributes->data->length) ? $attributes->data->length->max : ''; $element = new Element\Textarea($name); $element->setName($label); $element->setLabel($label); $element->setAttributes(array('placeholder' => $placeholder, 'required' => $required, 'class' => $class, 'id' => $id)); $form->add($element); $options = array(); $options['encoding'] = 'UTF-8'; if ($lengthMin && $lengthMin > 0) { $options['min'] = $lengthMin; } if ($lengthMax && $lengthMax > $lengthMin) { $options['max'] = $lengthMax; $element->setAttribute('maxlength', $lengthMax); } $inputFilter->add($factory->createInput(array('name' => $name, 'required' => $required, 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'StringLength', 'options' => $options))))); } if (isset($element->line_upload)) { $attributes = $element->line_upload[0]; //print_r($attributes); $name = isset($attributes->name) ? $attributes->name : ''; $type = isset($attributes->type) ? $attributes->type : ''; $position = isset($attributes->order) ? $attributes->order : ''; $label = isset($attributes->data->label) ? $attributes->data->label : ''; $required = $attributes->data->required == 'true' ? true : false; $class = isset($attributes->data->class) ? $attributes->data->class : ''; $id = isset($attributes->data->id) ? $attributes->data->id : ''; $filesizeMin = isset($attributes->data->filesize) ? $attributes->data->filesize->min : ''; $filesizeMax = isset($attributes->data->filesize) ? $attributes->data->filesize->max : ''; $element = new Element\File($name); $element->setLabel($label); $element->setName($label); $element->setAttributes(array('required' => $required, 'class' => $class, 'id' => $id)); $form->add($element); $inputFilter->add($factory->createInput(array('name' => $name, 'required' => $required, 'validators' => array(array('name' => '\\Zend\\Validator\\File\\Size', 'options' => array('max' => 10 * 1024 * 1024)), array('name' => '\\Zend\\Validator\\File\\Extension', 'options' => array('png,PNG,jpg,JPG,jpeg,JPEG,gif,GIF', 'messages' => array(\Zend\Validator\File\Extension::FALSE_EXTENSION => 'Veuillez télécharger une image'))))))); } if (isset($element->line_radio)) { $attributes = $element->line_radio[0]; $name = isset($attributes->name) ? $attributes->name : ''; $type = isset($attributes->type) ? $attributes->type : ''; $position = isset($attributes->order) ? $attributes->order : ''; $label = isset($attributes->data->label) ? $attributes->data->label : ''; // $required = ($attributes->data->required == 'yes') ? true : false; $required = false; $class = isset($attributes->data->class) ? $attributes->data->class : ''; $id = isset($attributes->data->id) ? $attributes->data->id : ''; $lengthMin = isset($attributes->data->length) ? $attributes->data->length->min : ''; $lengthMax = isset($attributes->data->length) ? $attributes->data->length->max : ''; $innerData = isset($attributes->data->innerData) ? $attributes->data->innerData : array(); $element = new Element\Radio($name); $element->setLabel($label); $element->setName($label); $element->setAttributes(array('name' => $name, 'required' => $required, 'allowEmpty' => !$required, 'class' => $class, 'id' => $id)); $values = array(); foreach ($innerData as $value) { $values[] = $value->label; } $element->setValueOptions($values); $form->add($element); } if (isset($element->line_dropdown)) { $attributes = $element->line_dropdown[0]; $name = isset($attributes->name) ? $attributes->name : ''; $type = isset($attributes->type) ? $attributes->type : ''; $position = isset($attributes->order) ? $attributes->order : ''; $label = isset($attributes->data->label) ? $attributes->data->label : ''; // $required = ($attributes->data->required == 'yes') ? true : false; $required = false; $class = isset($attributes->data->class) ? $attributes->data->class : ''; $id = isset($attributes->data->id) ? $attributes->data->id : ''; $lengthMin = isset($attributes->data->length) ? $attributes->data->length->min : ''; $lengthMax = isset($attributes->data->length) ? $attributes->data->length->max : ''; $dropdownValues = isset($attributes->data->dropdownValues) ? $attributes->data->dropdownValues : array(); $element = new Element\Select($name); $element->setLabel($label); $element->setName($label); $element->setAttributes(array('name' => $name, 'required' => $required, 'allowEmpty' => !$required, 'class' => $class, 'id' => $id)); $values = array(); foreach ($dropdownValues as $value) { $values[] = $value->dropdown_label; } $element->setValueOptions($values); $form->add($element); } } $form->setInputFilter($inputFilter); return $form; }