public function __construct(AuthenticationService $authService) { parent::__construct('login'); $this->filter = new InputFilter(); $email = new Element\Email('email'); $email->setAttribute('required', true); $email->setAttribute('placeholder', 'Email Address'); $this->add($email); $emailFilter = new Input('email'); $emailFilter->setRequired(true); $this->filter->add($emailFilter); $password = new Element\Password('password'); $password->setAttribute('required', true); $password->setAttribute('placeholder', 'Password'); $this->add($password); $passwordFilter = new Input('password'); $passwordFilter->setRequired(true); $passwordFilter->getValidatorChain()->attach(new AuthValidator\Authentication(array('message' => 'Invalid email address or password', 'service' => $authService, 'adapter' => $authService->getAdapter(), 'identity' => 'email', 'credential' => 'password'))); $this->filter->add($passwordFilter); $buttons = new Form('buttons'); $buttons->setOption('twb-layout', 'inline'); $buttons->setAttribute('class', 'form-group'); $submit = new Element\Submit('submit'); $submit->setAttribute('class', 'btn-primary pull-right'); $submit->setOption('glyphicon', 'log-in'); $submit->setLabel('Log In'); $buttons->add($submit); $forgot = new Element\Submit('forgot'); $forgot->setAttribute('formnovalidate', true); $forgot->setAttribute('class', 'btn-warning pull-right'); $forgot->setOption('glyphicon', 'question-sign'); $forgot->setLabel('Forgot Password'); $buttons->add($forgot); $this->add($buttons); }
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); }
public function addElements() { $file = new Element\File('image-file'); $file->setLabel('Edit Your Image')->setAttribute('id', 'image-file')->setAttribute('multiple', true); $this->add($file); $submit = new Element\Submit('submit'); $submit->setValue('Validation'); $submit->setAttribute('class', 'btn btn-primary'); $submit->setAttribute('id', 'submit'); $this->add($submit); }
public function __construct() { parent::__construct('category'); $this->setHydrator(new ClassMethodsHydrator(false)); $this->add(array('name' => 'id', 'type' => 'hidden')); $this->add(array('name' => 'title', 'type' => 'text', 'attributes' => array('class' => 'form-control', 'placeholder' => 'category'))); $submitField = new Element\Submit('submit'); $submitField->setValue('Validation'); $submitField->setAttribute('class', 'btn btn-primary'); $submitField->setAttribute('id', 'submitbutton'); $this->add($submitField); }
public function __construct(ObjectManager $objectManager) { parent::__construct('post-form'); $this->setHydrator(new DoctrineHydrator($objectManager, 'TinyBlog\\Entity\\Post', true)); $this->setAttribute('class', 'form-horizontal'); $postFieldset = new PostFieldset($objectManager); $postFieldset->setUseAsBaseFieldset(true); $this->add($postFieldset); $this->add(array('type' => 'Zend\\Form\\Element\\Csrf', 'name' => 'csrf')); $submitField = new Element\Submit('submit'); $submitField->setValue('Validation'); $submitField->setAttribute('class', 'btn btn-primary'); $submitField->setAttribute('id', 'submitbutton'); $this->add($submitField); }
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 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); }
/** * @param string $submitName * @param string $submitClass */ public function __construct($submitName = 'Save', $submitClass = 'btn-primary') { parent::__construct('buttons'); $this->setOption('twb-layout', 'inline'); $this->setAttribute('class', 'form-group'); $submit = new Element\Submit('submit'); $submit->setAttribute('value', $submitName); $submit->setAttribute('class', $submitClass . ' pull-right'); $this->add($submit); $cancel = new Element\Submit('cancel'); $cancel->setAttribute('value', 'Cancel'); $cancel->setAttribute('formnovalidate', true); $cancel->setAttribute('data-dismiss', 'modal'); $cancel->setAttribute('class', 'btn-warning pull-right'); $this->add($cancel); }
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($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); }
/** * 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() { 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); }
/** * Add submit element */ public function addSubmitElement($name = 'save', $label = 'Speichern') { $element = new Submit($name); $element->setValue($label); $element->setAttribute('class', 'btn'); $this->add($element); }
public function buildForm() { $this->setAttribute('method', 'POST'); $category = new Select('category'); $category->setLabel('Category')->setValueOptions(array_combine($this->getCategories(), $this->getCategories())); $title = new Text('title'); $title->setLabel('Title')->setAttributes(array('size' => 50, 'maxLength' => 128, 'required' => 'required', 'placeholder' => 'Title', 'title' => 'Title')); $photo = new Text('photo_filename'); $photo->setLabel('Photo')->setAttribute('maxlength', 1024)->setAttribute('placeholder', 'Enter a valid image file URL'); $name = new Text('contact_name'); $name->setLabel('Contact Name')->setAttribute('title', 'Contact Name')->setAttribute('size', 50)->setAttribute('maxlength', 255); $email = new Email('contact_email'); $email->setLabel('Contact Email')->setAttribute('title', 'Contact Email')->setAttribute('size', 50)->setAttribute('maxlength', 255); $phone = new Text('contact_phone'); $phone->setLabel('Contact Phone Number')->setAttribute('title', 'Contact Phone Number')->setAttribute('size', 20)->setAttribute('maxlength', 32); $city = new Select('cityCode'); $city->setLabel('Nearest City')->setValueOptions(array_combine(self::$cityCodes, self::$cityCodes))->setAttribute('id', 'cityCode'); $price = new Text('price'); $price->setLabel('Price')->setAttribute('title', 'Price as nnn.nn')->setAttribute('size', 16)->setAttribute('maxlength', 16); $expires = new Radio('expires'); $expires->setLabel('Expires')->setAttribute('title', 'The expiration date from today')->setAttribute('class', 'expiresButton')->setValueOptions($this->getExpireDays()); $deleteCode = new Text('delete_code'); $deleteCode->setLabel('Delete Code')->setAttribute('title', 'Delete code for this item')->setAttribute('size', 16)->setAttribute('maxlength', 16); $description = new Textarea('description'); $description->setLabel('Description')->setAttribute('title', 'Description')->setAttribute('rows', 5)->setAttribute('cols', 80); $captchaAdapter = new ImageCaptcha(); $captchaAdapter->setWordlen(4)->setOptions($this->captchaOptions); $captcha = new Captcha('captcha'); $captcha->setCaptcha($captchaAdapter)->setLabel('Help us to prevent SPAM!')->setAttribute('class', 'captchaStyle')->setAttribute('title', 'Help us to prevent SPAM'); $submit = new Submit('submit'); $submit->setAttribute('value', 'Post'); $this->add($category)->add($title)->add($photo)->add($name)->add($email)->add($phone)->add($city)->add($price)->add($expires)->add($deleteCode)->add($description)->add($captcha)->add($submit); }
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 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($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('password'); $this->filter = new InputFilter(); $oldPassword = new Element\Password('oldPassword'); $oldPassword->setAttribute('required', true); $oldPassword->setAttribute('placeholder', 'Current Password'); $this->add($oldPassword); $oldPasswordFilter = new Input('oldPassword'); $oldPasswordFilter->setRequired(true); $this->filter->add($oldPasswordFilter); $newPassword = new Element\Password('newPassword'); $newPassword->setAttribute('required', true); $newPassword->setAttribute('placeholder', 'New Password'); $this->add($newPassword); $newPasswordFilter = new Input('newPassword'); $newPasswordFilter->setRequired(true); $newPasswordFilter->getFilterChain()->attach(new Filter\StringTrim()); $newPasswordFilter->getValidatorChain()->attach(new AppValidator\PasswordStrength()); $this->filter->add($newPasswordFilter); $confirmPassword = new Element\Password('confirmPassword'); $confirmPassword->setAttribute('required', true); $confirmPassword->setAttribute('placeholder', 'Confirm New Password'); $this->add($confirmPassword); $confirmPasswordFilter = new Input('confirmPassword'); $confirmPasswordFilter->setRequired(true); $confirmPasswordFilter->getFilterChain()->attach(new Filter\StringTrim()); $confirmPasswordFilter->getValidatorChain()->attach(new Validator\Identical('newPassword')); $this->filter->add($confirmPasswordFilter); $buttons = new Form('buttons'); $buttons->setOption('twb-layout', 'inline'); $buttons->setAttribute('class', 'form-group'); $submit = new Element\Submit('submit'); $submit->setAttribute('class', 'btn-primary pull-right'); $submit->setOption('glyphicon', 'lock'); $submit->setLabel('Change Password'); $buttons->add($submit); $cancel = new Element\Submit('cancel'); $cancel->setAttribute('formnovalidate', true); $cancel->setAttribute('class', 'btn-warning pull-right'); $cancel->setOption('glyphicon', 'ban-circle'); $cancel->setLabel('Cancel'); $buttons->add($cancel); $this->add($buttons); }
public function __construct() { parent::__construct('delete'); $this->setAttribute('method', 'post'); $submit = new Submit('delete'); $submit->setAttribute('class', 'btn btn-danger'); $submit->setValue('Delete'); $this->add($submit); }
public function getButtonFieldset() { // Fieldset for buttons $buttons = new Fieldset('buttons'); $buttons->setAttribute('class', 'well well-small'); // Add the save button $save = new Element\Submit('submit'); $save->setValue('Save'); $save->setAttribute('class', 'btn btn-primary'); $buttons->add($save); // Add the delete button $delete = new Element\Submit('delete'); $delete->setValue('Delete'); $delete->setAttribute('class', 'btn btn-danger'); $delete->setAttribute('onClick', "return confirm('Are you sure?')"); $buttons->add($delete); return $buttons; }
public function __construct() { parent::__construct('confirm'); $buttons = new Form('buttons'); $buttons->setOption('twb-layout', 'inline'); $buttons->setAttribute('class', 'form-group'); $submit = new Element\Submit('confirm'); $submit->setAttribute('class', 'btn-primary pull-right'); $submit->setOption('glyphicon', 'lock'); $submit->setLabel('Secure Checkout with PayPal'); $buttons->add($submit); $back = new Element\Submit('back'); $back->setAttribute('formnovalidate', true); $back->setAttribute('class', 'btn-warning pull-right'); $back->setOption('glyphicon', 'chevron-left'); $back->setLabel('Go Back'); $buttons->add($back); $this->add($buttons); }
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 init() { parent::__construct('forgotPassword'); $email = new Text('email'); $email->setAttribute('id', 'email'); $email->setAttribute('required', 'required')->setAttribute('placeholder', $this->translator->translate('forgotPassword.email.placeholder')); $this->add($email); $submit = new Submit('submit'); $submit->setAttribute('class', 'button'); $submit->setValue($this->translator->translate('forgotPassword.submit.value')); $this->add($submit); return $this; }
public function __construct() { parent::__construct(); $this->setAttribute('method', 'post'); $this->setAttribute('class', 'panel-body'); $confirm = new Checkbox('confirm'); $confirm->setLabel('confirm.account.deletion'); $confirm->setAttribute('class', 'checkbox form-control'); $this->add($confirm); $submit = new Submit('send'); $submit->setValue('delete.account'); $submit->setAttribute('class', 'btn btn-danger'); $this->add($submit); }
public function init() { $title = new Element\Text('title'); $title->setLabel('Title'); $title->setAttribute('class', 'form-control'); $this->add($title); $artist = new Element\Text('artist'); $artist->setLabel('Artist'); $artist->setAttribute('class', 'form-control'); $this->add($artist); $submit = new Element\Submit('submit'); $submit->setAttribute('class', 'btn btn-info'); $submit->setValue('Create'); $this->add($submit); }
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 __construct() { parent::__construct('search'); $this->setAttribute('class', 'pull-left'); $this->setAttribute('method', 'GET'); $q = new Element\Text('q'); $q->setAttribute('placeholder', 'Search...'); $q->setAttribute('required', true); $this->add($q); $submit = new Element\Submit('submit'); $submit->setAttribute('class', 'btn-primary pull-right'); $submit->setOption('glyphicon', 'search'); $submit->setLabel('Search'); $this->add($submit); }
public function init() { parent::__construct('newPassword'); $password = new Password('password'); $password->setAttribute('id', 'password'); $password->setAttribute('placeholder', $this->translator->translate('newPassword.password.placeholder')); $this->add($password); $passwordRepeat = new Password('passwordRepeat'); $passwordRepeat->setAttribute('id', 'passwordRepeat'); $passwordRepeat->setAttribute('placeholder', $this->translator->translate('newPassword.passwordRepeat.placeholder')); $this->add($passwordRepeat); $submit = new Submit('submit'); $submit->setAttribute('class', 'button'); $submit->setValue($this->translator->translate('newPassword.submit.value')); $this->add($submit); return $this; }
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 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); }