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() { // we want to ignore the name passed parent::__construct('communication'); $this->add(new Element\Hidden('id_party')); $this->add(new Element\Hidden('nid_commtype')); $this->add(new Element\Hidden('access_detail')); $this->add(new Element\Hidden('access_form')); $this->setAttribute('method', 'post'); $this->get('access_detail')->setLabel('Account / Number'); $num_primary_order = new Element\Text('num_primary_order'); $num_primary_order->setLabel('Number Primary Order')->setAttributes(array('class' => 'form-control input-sm')); $this->add($num_primary_order); $id_address = new Element\Select('id_address'); $id_address->setLabel('Address')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('' => 'No Address Binded')); $this->add($id_address); $comment = new Element\Textarea('comment'); $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm')); $this->add($comment); $back = new Element\Button('back'); $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => '')); $this->add($back); $submit = new Element\Submit('submit'); $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm')); $this->add($submit); }
public function __construct($name = 'workflowform') { // $this->setDbAdapter($dbAdapter); // we want to ignore the name passed parent::__construct($name); $dbAdapter = GlobalAdapterFeature::getStaticAdapter(); if ($dbAdapter != null) { $this->setDbAdapter($dbAdapter); } else { throw new \Exception('no dbAdapter loaded'); } // $workflowElement = new Collection('workflow'); // $workflowElement->setOptions(array( // 'label' => 'Workflow', // 'target_element' => array( // 'type' => 'CookingAssist\Form\WorkflowFieldset') // )); // $this->add($workflowElement); $this->add(array('name' => 'Id', 'type' => 'Hidden')); $this->add(array('name' => 'Title', 'type' => 'Text', 'options' => array('label' => 'Titel'))); $this->add(array('name' => 'Tipp', 'type' => 'Text', 'options' => array('label' => 'Tipp'))); $submitElement = new Submit('Submit'); $submitElement->setValue('Hinzufügen'); $this->add($submitElement); }
public function __construct($name = null) { parent::__construct('book'); $this->add(array('name' => 'id', 'type' => 'Hidden')); $this->add(array('name' => 'title', 'type' => 'text', 'options' => array('label' => 'Title'))); /* $this->add(array( 'name' => 'author', 'type' => 'text', 'options' => array( 'label' => 'author', ), )); */ $authorTextInput = new Element\Text($name = 'author'); $authorTextInput->setLabel('author'); $this->add($authorTextInput); /* $this->add(array( 'name' => 'submit', 'type' => 'submit', 'attributes' => array( 'value' => 'Go', 'id' => 'submitbutton', ), )); */ $submitButton = new Element\Submit($name = 'submit'); $submitButton->setAttribute('value', 'Go'); $submitButton->setAttribute('id', 'submitButton'); $this->add($submitButton); }
/** * The default action - show the home page */ public function indexAction() { // init vars $data = NULL; $table = $this->getServiceLocator()->get('city-codes-table'); $catList = $this->getServiceLocator()->get('form-demo-categories'); $cityList = $table->getAllCityCodesForForm(); $countryList = $table->getAllCountryCodesForForm(); // submit button $submit = new Submit('submit'); $submit->setAttribute('value', 'Submit'); // build form $builder = new AnnotationBuilder(); $entity = $this->getServiceLocator()->get('form-demo-listings-entity'); $form = $builder->createForm($entity); $form->get('category')->setValueOptions(array_combine($catList, $catList)); $form->getInputFilter()->get('category')->getValidatorChain()->attachByName('InArray', array('haystack' => $catList)); $form->get('country')->setValueOptions($countryList); $form->getInputFilter()->get('country')->getValidatorChain()->attachByName('InArray', array('haystack' => $countryList)); $form->add($submit); $form->bind($entity); if ($this->getRequest()->isPost()) { $form->setData($this->params()->fromPost()); if ($form->isValid()) { $data = $form->getData(); } } return new ViewModel(array('form' => $form, 'data' => $data, 'cityList' => $cityList)); }
public function __construct($name = null) { parent::__construct('menus'); $this->setAttribute('class', 'form-horizontal'); $this->setAttribute('id', 'searchform'); $this->setAttribute('method', 'post'); $formValue = $this->formValue(); $name = new Element\Text('name'); $name->setLabel('Name')->setAttribute('class', 'required form-control')->setAttribute('id', 'name')->setAttribute('placeholder', 'Name'); $type = new Element\Select('type'); $type->setLabel('Type')->setAttribute('class', 'required form-control')->setValueOptions($formValue['type'])->setDisableInArrayValidator(true)->setAttribute('id', 'type')->setAttribute('placeholder', 'Type'); $resource_id = new Element\Select('resource_id'); $resource_id->setLabel('Resource')->setAttribute('class', 'required form-control')->setOptions(array())->setDisableInArrayValidator(true)->setAttribute('id', 'resource_id')->setAttribute('placeholder', 'Resource'); $url = new Element\Text('url'); $url->setLabel('Url')->setAttribute('class', 'required form-control')->setAttribute('id', 'url')->setAttribute('placeholder', 'Url'); $target = new Element\Select('target'); $target->setLabel('Target')->setAttribute('class', 'required form-control')->setValueOptions($formValue['target'])->setDisableInArrayValidator(true)->setAttribute('id', 'target')->setAttribute('placeholder', 'Target'); $parent_id = new Element\Select('parent_id'); $parent_id->setLabel('Parent')->setAttribute('class', 'required form-control')->setOptions(array())->setDisableInArrayValidator(true)->setAttribute('id', 'parent_id')->setAttribute('placeholder', 'Parent Id'); $status = new Element\Select('status'); $status->setLabel('Status')->setAttribute('class', 'required form-control')->setValueOptions($formValue['status'])->setDisableInArrayValidator(true)->setAttribute('id', 'status')->setAttribute('placeholder', 'Status'); $submit = new Element\Submit('submit'); $submit->setValue('Search')->setAttribute('class', 'btn btn-primary'); $this->add($name); $this->add($type); $this->add($resource_id); $this->add($url); $this->add($target); $this->add($parent_id); $this->add($status); $this->add($submit); }
protected function getSubmit() { $element = new Submit('logar'); $element->setValue('Logar'); $element->setAttributes(array('class' => 'btn btn-primary')); return $element; }
protected function getSubmit() { $element = new Submit('alterar'); $element->setValue('Alterar Dados de Acesso'); $element->setAttributes(array('class' => 'btn btn-primary')); return $element; }
public function __construct(ServiceLocatorInterface $sm) { parent::__construct('formPost'); // definindo variáveis $em = $sm->get('Doctrine\\ORM\\EntityManager'); $arrCategorias = array("" => "Selecione"); $repoCategoria = $em->getRepository('Admin\\Entity\\Categoria'); $arrCategorias += $repoCategoria->fetchPairs(); $categoria = new Select('categoria'); $categoria->setLabel('Categoria')->setAttributes(array('id' => 'categoria', 'class' => 'form-control', 'options' => $arrCategorias)); $this->add($categoria); $nome = new Text('nome'); $nome->setLabel('Nome')->setAttributes(array('id' => 'nome', 'class' => 'form-control', 'placeholder' => 'Digite o seu nome')); $this->add($nome); $descricao = new Textarea('descricao'); $descricao->setLabel('Descrição')->setAttributes(array('id' => 'descricao', 'class' => 'form-control', 'style' => 'height: 80px', 'placeholder' => 'Digite a descrição do post')); $this->add($descricao); $conteudo = new Textarea('conteudo'); $conteudo->setLabel('Conteúdo')->setAttributes(array('id' => 'conteudo', 'class' => 'form-control', 'style' => 'min-height: 150px', 'placeholder' => 'Digite o conteúdo do post')); $this->add($conteudo); $tags = new Text('tags'); $tags->setLabel('Tags')->setAttributes(array('id' => 'tags', 'class' => 'form-control', 'placeholder' => 'Digite as tags do conteúdo')); $this->add($tags); $submit = new Submit('submit'); $submit->setValue('Salvar'); $this->add($submit); }
public function __construct() { // we want to ignore the name passed parent::__construct('Attachment'); $this->add(new Element\Hidden('target_type_object')); $this->add(new Element\Hidden('target_id_row')); $this->setAttribute('method', 'post'); $nid_lov_attachmenttype = new Element\Select('nid_lov_attachmenttype'); $nid_lov_attachmenttype->setLabel('Attachment Type')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('' => 'Select a attachment type')); $this->add($nid_lov_attachmenttype); $url_or_filepath = new Element\Text('url_or_filepath'); $url_or_filepath->setLabel('Url or file path')->setAttributes(array('class' => 'form-control input-sm')); $this->add($url_or_filepath); $filename = new Element\Text('filename'); $filename->setLabel('File Name')->setAttributes(array('class' => 'form-control input-sm')); $this->add($filename); $filesize = new Element\Text('filesize'); $filesize->setLabel('File Size')->setAttributes(array('class' => 'form-control input-sm')); $this->add($filesize); $mimetype = new Element\Text('mimetype'); $mimetype->setLabel('Mime Type')->setAttributes(array('class' => 'form-control input-sm')); $this->add($mimetype); $bool_active = new Element\Radio('bool_active'); $bool_active->setLabel('Is Active?')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite')); $this->add($bool_active); $comment = new Element\Textarea('comment'); $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm')); $this->add($comment); $back = new Element\Button('back'); $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => '')); $this->add($back); $submit = new Element\Submit('submit'); $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm')); $this->add($submit); }
public function __construct($name = null, $options = array()) { //Formulario //Contruimos el formulario en base al padre parent::__construct('login', $options); //seteamos el actiond el formulario $this->setAttributes(array('action' => '/application/index/login')); //Elementos //Creamos un elemento de tipo texto y seteamos su atributo name $e = new Element\Text('name'); //Seteamos los atributos del elemento $e->setAttributes(array('id' => 'txt_name', 'class' => 'txt_name_clase')); //seteamos las opciones del elemento $e->setOptions(array('label' => 'Usuario: ')); //añadimos al formulario $this->add($e); //Definimos los parametros del elemento a generar $e = array('type' => 'password', 'name' => 'password', 'attributes' => array('id' => `txt_password`, 'class' => 'txt_password_clase'), 'options' => array('label' => 'Clave: ')); //agregamo el elemento $this->add($e); //Agregando un boton $e = new Element\Submit('enviar'); $e->setAttributes(array('id' => `btn_login`, 'value' => 'Enviar', 'class' => 'btn_login')); $this->add($e); }
public function __construct() { parent::__construct(); $this->setAttribute('method', 'post'); $this->setAttribute('action', '/user/login'); $this->setAttribute('class', 'form'); $this->setAttribute('id', 'userLoginForm'); $this->setAttribute('role', 'form'); $email = new Email(); $email->setName('email')->setLabel('Email Address')->setAttribute('required', 'true'); $password = new Password(); $password->setName('password')->setLabel('Password')->setAttribute('required', 'true'); $csrf = new Csrf(); $csrf->setName('prev'); $checkbox = new Checkbox(); $checkbox->setName('remember-me'); $checkbox->setOptions(['use_hidden_element' => false, 'required' => false]); $checkbox->setChecked("checked"); $submit = new Submit(); $submit->setName('submit')->setValue('Sign In'); $this->add($email)->add($password)->add($checkbox)->add($csrf)->add($submit); foreach ($this->elements as $element) { if ($element instanceof Checkbox) { $element->setAttributes(['class' => 'custom-checkbox', 'data-toggle' => 'checkbox']); } else { if ($element instanceof Submit) { $element->setAttributes(['class' => 'btn-inverse btn-large', 'id' => 'loginSubmit']); } else { $element->setAttribute('class', 'form-control'); } } } }
public function __construct() { // we want to ignore the name passed parent::__construct('resp'); $this->setAttribute('method', 'post'); $name_resp = new Element\Text('name_resp'); $name_resp->setLabel('Responsibility')->setAttributes(array('class' => 'form-control input-sm')); $this->add($name_resp); $nid_lov_resptype = new Element\Select('nid_lov_resptype'); $nid_lov_resptype->setLabel('Type')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a type')); $this->add($nid_lov_resptype); $nid_timezone = new Element\Select('nid_timezone'); $nid_timezone->setLabel('Time Zone')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a timezone')); $this->add($nid_timezone); $id_locale = new Element\Select('nid_locale'); $id_locale->setLabel('Locale')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a locale')); $this->add($id_locale); $nid_language = new Element\Select('nid_language'); $nid_language->setLabel('Language')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a language')); $this->add($nid_language); $comment = new Element\Textarea('comment'); $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm')); $this->add($comment); $back = new Element\Button('back'); $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => '')); $this->add($back); $submit = new Element\Submit('submit'); $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm')); $this->add($submit); }
public function init() { $this->setMethod('POST'); $element = new Element\Text('title'); $element->setLabel('Title:'); $element->setRequired(true); $this->addElement($element); $element = new Element\Select('name'); $element->setLabel('Directory:'); $element->setRequired(true); $element->addMultiOptions($this->model->getThemesDirectoriesFromFS()); $this->addElement($element); $element = new Element\Radio('active'); $element->setSeparator(' '); $element->setLabel('Active:'); $element->setValue(false); $element->setMultiOptions(array('1' => 'Yes', '0' => 'No')); $element->setRequired(true); $this->addElement($element); $element = new Element\Text('ordering'); $element->setLabel('Ordering:'); $element->setRequired(true); $this->addElement($element); $element = new Element\Submit('submit'); $element->setLabel('Save'); $element->setIgnore(true); $this->addElement($element); }
public function addElements() { //-- Profile name -- $login = new Element\Text('profile_name'); $login->setAttribute('placeholder', 'profile_name'); $login->setAttribute('required', 'true'); $login->setAttribute('class', 'form-control'); $login->setAttribute('id', 'profile-name'); $login->setLabel('Profile name'); $login->setLabelAttributes(array('class' => 'control-label', 'for' => 'profile-name')); //-- Password -- $password = new Element\Password('password'); $password->setAttribute('placeholder', '*****'); $password->setAttribute('required', 'true'); $password->setAttribute('class', 'form-control'); $password->setAttribute('id', 'password'); $password->setLabel('Password'); $password->setLabelAttributes(array('class' => 'control-label', 'for' => 'password')); //-- Submit -- $submit = new Element\Submit('submit'); $submit->setAttribute('class', 'btn btn-success'); $submit->setValue('Send'); // Binding elements $this->add($login); $this->add($password); $this->add($submit); }
public function prepareElements($topicList, $categoryList, $captchaOptions) { // repurpose $topicList and $categoryList $topics = array('---' => 'Choose'); foreach ($topicList as $item) { $topics[$item->item] = $item->item; } $categories = array('---' => 'Choose'); foreach ($categoryList as $item) { $categories[$item->item] = $item->item; } $author = new Element\Hidden('author'); $category1 = new Element\Text('category'); $category1->setLabel('Category')->setAttribute('title', 'Enter a category: i.e. zf2 or use the dropdown list below')->setAttribute('size', 16)->setAttribute('maxlength', 16); $category2 = new Element\Select('selectCategory'); $category2->setValueOptions($categories); $topic1 = new Element\Text('topic'); $topic1->setLabel('Topic')->setAttribute('title', 'Enter a topic code: i.e. zf2f-2013-02-25 or use the dropdown list below')->setAttribute('size', 60)->setAttribute('maxlength', 254); $topic2 = new Element\Select('selectTopic'); $topic2->setValueOptions($topics); $title = new Element\Text('title'); $title->setLabel('Title')->setAttribute('title', 'Enter a suitable title for this posting')->setAttribute('size', 60)->setAttribute('maxlength', 254); $body = new Element\Textarea('body'); $body->setLabel('Body')->setAttribute('title', 'Enter the body for this posting')->setAttribute('rows', 4)->setAttribute('cols', 60); $captcha = new Element\Captcha('captcha'); $captchaAdapter = new Captcha\Image(); $captchaAdapter->setWordlen(4)->setOptions($captchaOptions); $captcha->setCaptcha($captchaAdapter)->setLabel('Help us to prevent SPAM!')->setAttribute('class', 'captchaStyle')->setAttribute('title', 'Help to prevent SPAM'); $submit = new Element\Submit('submit'); $submit->setAttribute('value', 'Post')->setAttribute('title', 'Click here when done'); $this->add($author)->add($topic1)->add($topic2)->add($category1)->add($category2)->add($title)->add($body)->add($captcha)->add($submit); }
public function __construct() { // we want to ignore the name passed parent::__construct('orgtype'); $this->setAttribute('method', 'post'); $type_organization = new Element\Text('type_organization'); $type_organization->setLabel('Organization Type')->setAttributes(array('class' => 'form-control input-sm')); $this->add($type_organization); $genre = new Element\Text('genre'); $genre->setLabel('Genre')->setAttributes(array('class' => 'form-control input-sm')); $this->add($genre); $bool_unioned = new Element\Radio('bool_unioned'); $bool_unioned->setLabel('Unioned ?')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No')); $this->add($bool_unioned); $registered_location = new Element\Text('registered_location'); $registered_location->setLabel('Registered Location')->setAttributes(array('class' => 'form-control input-sm')); $this->add($registered_location); $comment = new Element\Textarea('comment'); $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm')); $this->add($comment); $back = new Element\Button('back'); $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => '')); $this->add($back); $submit = new Element\Submit('submit'); $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm')); $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 __construct(EntityManager $entityManager) { parent::__construct(); $this->entityManager = $entityManager; $this->setAttributes(array("method" => "post", "enctype" => "multipart/form-data", "class" => "form")); $this->setInputFilter(new FaqPerguntasFilters()); // Campo de titulo $titulo = new Text('titulo'); $titulo->setLabel("* Título")->setAttributes(array("maxLength" => "200", "class" => "form-control", "required" => "required")); // Campo de resposta $resposta = new Textarea('resposta'); $resposta->setLabel('* Resposta'); $resposta->setAttributes(array('class' => 'file form-control editor', 'cols' => '30', 'rows' => '10')); // Campo de titulo $tags = new Text('tags'); $tags->setLabel("* Tags")->setAttributes(array("maxLength" => "1000", "class" => "form-control count-character", "required" => "required")); // Campo categoria $categorias = new Select('id_categoria'); $categorias->setLabel("* Categoria")->setAttribute("class", "select")->setValueOptions($this->getCategorias()); // Botão de Submit $botao = new Submit("submit"); $botao->setAttributes(array("value" => "Salvar")); // Adiciona campos $this->add($titulo)->add($resposta)->add($tags)->add($categorias)->add($botao); }
public function addElements() { //-- E-mail current ------------------------------------ $email_current = new Element\Email('email_current'); $email_current->setAttribute('readonly', 'true'); $email_current->setAttribute('class', 'form-control'); $email_current->setAttribute('id', 'email-old'); $email_current->setLabel('Current'); $email_current->setLabelAttributes(array('class' => 'control-label', 'for' => 'email-current')); //-- E-mail new --------------------------------------- $email = new Element\Email('email'); $email->setAttribute('placeholder', '*****@*****.**'); $email->setAttribute('required', 'true'); $email->setAttribute('class', 'form-control'); $email->setAttribute('id', 'email'); $email->setLabel('New'); $email->setLabelAttributes(array('class' => 'control-label', 'for' => 'email')); //-- Submit ------------------------------------- $submit = new Element\Submit('submit'); $submit->setAttribute('class', 'btn btn-success'); $submit->setValue('Send'); // Binding elements $this->add($email_current); $this->add($email); $this->add($submit); }
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 __construct(EntityManager $objectManager) { parent::__construct('ligue'); $this->setAttributes(array('method' => 'post', 'id' => 'auth', 'role' => 'form')); $this->setInputFilter(new LigueFilter($objectManager)); $this->setHydrator(new DoctrineObject($objectManager)); // Id $id = new Hidden('id'); $this->add($id); // Nom $nom = new Text('nom'); $nom->setLabel('Nom')->setLabelAttributes(array('class', 'control-label')); $nom->setAttributes(array('id' => 'nom', 'class' => 'form-control', 'placeholder' => 'Nom', 'required' => true)); $this->add($nom); // Image $image = new File('image'); $image->setLabel('Image')->setLabelAttributes(array('class', 'control-label')); $image->setAttributes(array('id' => 'image', 'class' => 'form-control', 'placeholder' => 'Image')); $this->add($image); // Date début $dateDebut = new Text('dateDebut'); $dateDebut->setLabel('Début de la ligue')->setLabelAttributes(array('class', 'control-label')); $dateDebut->setAttributes(array('id' => 'dateDebut', 'class' => 'form-control')); //$this->add($dateDebut); // Date fin $dateFin = new Text('dateFin'); $dateFin->setLabel('Fin de la ligue')->setLabelAttributes(array('class', 'control-label')); $dateFin->setAttributes(array('id' => 'dateFin', 'class' => 'form-control')); //$this->add($dateFin); // Submit $submit = new Submit('submit'); $submit->setValue('Enregistrer'); $submit->setAttributes(array('class' => 'btn btn-primary')); $this->add($submit); }
public function __construct(EntityManager $entityManager) { parent::__construct(); $this->entityManager = $entityManager; $this->setAttributes(array("method" => "post", "enctype" => "multipart/form-data", "class" => "form")); $this->setInputFilter(new HomeBannersFilters()); // Campo de titulo $titulo = new Text('titulo'); $titulo->setLabel("* Título")->setAttributes(array("maxLength" => "400", "class" => "form-control", "required" => "required")); // Campo tipo de midia $tipo = new Radio('tipo_banner'); $tipo->setLabel('Tipo de mídia'); $tipo->setValueOptions(array('IMAGEM' => 'Imagem', 'VIDEO' => 'Vídeo'))->setOptions(array('label_attributes' => array('class' => 'radio-inline')))->setAttribute("value", "IMAGEM"); // Campo de midia $file = new File("midia"); $file->setLabel('*Imagem (Tamanho exato de ' . \Base\Constant\Upload::BANNER_WIDTH . 'x' . \Base\Constant\Upload::BANNER_HEIGTH . ' px | ' . \Base\Constant\Upload::BANNER_MAX_SIZE . ')')->setAttribute('name', 'midia')->setAttribute('id', 'image'); // Campo de midia2 $file2 = new File("midia2"); $file2->setLabel('*Video (' . \Base\Constant\Upload::BANNER_MAX_SIZE . ')')->setAttribute('id', 'video'); // Botão de Submit $botao = new Submit("submit"); $botao->setAttributes(array("value" => "Salvar")); // Adiciona campos $this->add($titulo)->add($tipo)->add($file)->add($file2)->add($botao); }
public function prepareElements(array $categories) { $category = new Element\Select('category'); $category->setLabel('Category')->setOptions(array('options' => $categories)); $title = new Element\Text('title'); $title->setLabel('Title')->setAttribute('title', 'Enter a suitable title for this posting')->setAttribute('size', 40)->setAttribute('maxlength', 128); $priceMin = new Element\Text('priceMin'); $priceMin->setLabel('Minimum Price')->setAttribute('title', 'Enter mininum price as nnn.nn')->setAttribute('size', 16)->setAttribute('maxlength', 16); $priceMax = new Element\Text('priceMax'); $priceMax->setLabel('Maximum Price')->setAttribute('title', 'Enter maximum price as nnn.nn')->setAttribute('size', 16)->setAttribute('maxlength', 16); $expires = new Element\Date('expires'); $expires->setLabel('Expires')->setAttribute('title', 'The expiration date will be calculated from today')->setAttribute('size', 20)->setAttribute('maxlength', 20); $city = new Element\Text('city'); $city->setLabel('Nearest City')->setAttribute('title', 'Select the city of the item')->setAttribute('size', 40)->setAttribute('maxlength', 255); $country = new Element\Text('country'); $country->setLabel('Country Code')->setAttribute('title', 'Enter the 2 character ISO2 country code of the item')->setAttribute('size', 2)->setAttribute('maxlength', 2); $name = new Element\Text('name'); $name->setLabel('Contact Name')->setAttribute('title', 'Enter the name of the person to contact for this item')->setAttribute('size', 40)->setAttribute('maxlength', 255); $phone = new Element\Text('phone'); $phone->setLabel('Contact Phone Number')->setAttribute('title', 'Enter the phone number of the person to contact for this item')->setAttribute('size', 20)->setAttribute('maxlength', 32); $email = new Element\Email('email'); $email->setLabel('Contact Email')->setAttribute('title', 'Enter the email address of the person to contact for this item')->setAttribute('size', 40)->setAttribute('maxlength', 255); $description = new Element\Textarea('description'); $description->setLabel('Description')->setAttribute('title', 'Enter a suitable description for this posting')->setAttribute('rows', 4)->setAttribute('cols', 80); $submit = new Element\Submit('submit'); $submit->setAttribute('value', 'Search')->setAttribute('title', 'Click here when done'); $this->add($category)->add($title)->add($priceMin)->add($priceMax)->add($expires)->add($city)->add($country)->add($name)->add($phone)->add($email)->add($description)->add($submit); }
public function __construct() { parent::__construct('personorg'); $this->setAttribute('method', 'post'); $this->add(new Element\Hidden('id_person')); $this->add(new Element\Hidden('id_organization')); $this->add(new Element\Hidden('bool_primary')); $this->add(new Element\Hidden('nid_lov_personorgtype')); $this->add(new Element\Hidden('dt_begin')); $name_title = new Element\Text('name_title'); $name_title->setLabel('Title')->setAttributes(array('class' => 'largewhite')); $this->add($name_title); $pnum_primary_order = new Element\Select('num_primary_order'); $pnum_primary_order->setLabel('Primary Order')->setAttributes(array('class' => 'tinywhite')); $this->add($pnum_primary_order); $dt_end = new Element\Date('dt_end'); $dt_end->setLabel('End Date')->setAttributes(array('class' => 'smallwhite', 'type' => 'date', 'id' => 'dt_end'))->setOptions(array('datepickerOptions' => array('changeYear: true', 'changeMonth: true', 'yearRange: "c-100:c+100"'))); $this->add($dt_end); $comment = new Element\Textarea('comment'); $comment->setLabel('Comment')->setAttributes(array('class' => 'smallwhite')); $this->add($comment); $back = new Element\Button('back'); $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn-success', 'style' => 'margin-right:70px;', 'onclick' => '')); $this->add($back); $submit = new Element\Submit('submit'); $submit->setValue('Login')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn-success', 'style' => 'margin: 10px 0 10px 140px')); $this->add($submit); }
public function __construct($useOldPassword = true) { parent::__construct(); $this->setAttribute('method', 'post'); $this->setAttribute('class', 'panel-body'); if ($useOldPassword) { $oldPassword = new Password('oldPassword'); $oldPassword->setLabel('old.password'); $oldPassword->setAttribute('class', 'form-control'); $this->add($oldPassword); } $password = new Password('password'); $password->setLabel('password'); $password->setAttribute('class', 'form-control'); $this->add($password); $password2 = new Password('password2'); $password2->setLabel('repeat.password'); $password2->setAttribute('class', 'form-control'); $this->add($password2); $captcha = new Captcha('register_captcha'); $imageAdapter = new Image(['font' => __DIR__ . '/../../fonts/arial.ttf']); $imageAdapter->setHeight(100); $imageAdapter->setWidth(400); $imageAdapter->setFontSize(48); $imageAdapter->setDotNoiseLevel(400); $imageAdapter->setLineNoiseLevel(40); $captcha->setCaptcha($imageAdapter); $captcha->setLabel('enter.text.from.the.picture'); $captcha->setAttribute('class', 'form-control'); $this->add($captcha); $submit = new Submit('save'); $submit->setValue('save'); $submit->setAttribute('class', 'btn btn-primary'); $this->add($submit); }
public function __construct($sm) { parent::__construct('resetPassword'); $this->sm = $sm; $altesPasswort = new Password('oldPass'); $altesPasswort->setLabel('LABEL_CHANGE_PASSWORD_OLD_PASS'); $altesPasswort->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $altesPasswort->setAttribute('class', 'form-control'); $altesPasswort->setAttribute('id', 'oldPass'); $this->add($altesPasswort); $neuesPasswort = new Password('newPass'); $neuesPasswort->setLabel('LABEL_CHANGE_PASSWORD_NEW_PASS'); $neuesPasswort->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $neuesPasswort->setAttribute('class', 'form-control'); $neuesPasswort->setAttribute('id', 'newPass'); $this->add($neuesPasswort); $neuesPasswortConfirm = new Password('newPassConfirm'); $neuesPasswortConfirm->setLabel('LABEL_CHANGE_PASSWORD_NEW_CONFIRM'); $neuesPasswortConfirm->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $neuesPasswortConfirm->setAttribute('class', 'form-control'); $neuesPasswortConfirm->setAttribute('id', 'newPassConfirm'); $this->add($neuesPasswortConfirm); $submit = new Submit('resetPasswordSubmit'); $submit->setValue('LABEL_CHANGE_PASSWORD_SUBMIT'); $submit->setAttribute('class', 'btn btn-default'); $this->add($submit); return $this; }
public function __construct() { parent::__construct('add'); $hydrator = new AggregateHydrator(); $hydrator->add(new PostHydrator()); $hydrator->add(new CategoryHydrator()); $this->setHydrator($hydrator); $title = new Element\Text('title'); $title->setLabel('Title'); $title->setAttribute('class', 'form-control'); $slug = new Element\Text('slug'); $slug->setLabel('Slug'); $slug->setAttribute('class', 'form-control'); $content = new Element\Textarea('content'); $content->setLabel('Content'); $content->setAttribute('class', 'form-control'); $category = new Element\Select('category_id'); $category->setLabel('Category'); $category->setAttribute('class', 'form-control'); $category->setValueOptions(array(1 => 'WIN', 2 => 'BUILD', 3 => 'SEND', 4 => 'GENERAL')); $submit = new Element\Submit('submit'); $submit->setValue('Add News'); $submit->setAttribute('class', 'btn btn-primary'); $this->add($title); $this->add($slug); $this->add($content); $this->add($category); $this->add($submit); }
public function __construct($name = 'mailchimp-sub-form', $options = array()) { parent::__construct($name, $options); $firstName = new Element\Text('firstName'); $firstName->setLabel('First Name'); $lastName = new Element\Text('lastName'); $lastName->setLabel('Last Name'); $email = new Element\Email('email'); $email->setLabel('Email Address'); $emailValidator = new Validator\EmailAddress(array('allow' => Validator\Hostname::ALLOW_DNS, 'domain' => true)); $email->setValidator($emailValidator); $privacyPolicy = new Element\Checkbox('privacyPolicy'); $privacyPolicy->setLabel('I accept the privacy policy and the terms of use'); $csrf = new Element\Csrf('mcSubCSRF'); $submit = new Element\Submit('submit'); $submit->setValue('Subscribe'); $this->add($firstName); $this->add($lastName); $this->add($email); $this->add($privacyPolicy); $this->add($csrf); $this->add($submit); $inputFilter = $this->getInputFilter(); $inputFilter->get($firstName->getName())->setAllowEmpty(false)->setRequired(true); $inputFilter->get($lastName->getName())->setAllowEmpty(false)->setRequired(true); }
public function __construct() { parent::__construct(); $this->setAttribute('method', 'post'); $this->setAttribute('class', 'panel-body'); $mail = new Email('email'); $mail->setLabel('email'); $mail->setAttribute('class', 'form-control'); $this->add($mail); $captcha = new Captcha('register_captcha'); $imageAdapter = new Image(['font' => __DIR__ . '/../../fonts/arial.ttf']); $imageAdapter->setHeight(100); $imageAdapter->setWidth(400); $imageAdapter->setFontSize(48); $imageAdapter->setDotNoiseLevel(400); $imageAdapter->setLineNoiseLevel(40); $captcha->setCaptcha($imageAdapter); $captcha->setLabel('enter.text.from.the.picture'); $captcha->setAttribute('class', 'form-control'); $this->add($captcha); $submit = new Submit('send'); $submit->setValue('send'); $submit->setAttribute('class', 'btn btn-primary'); $this->add($submit); }