public function init() { parent::init(); $this->add(array('name' => 'full_name', 'type' => 'text', 'options' => array('label' => $this->translate('Full name')))); $this->add(array('name' => 'company', 'type' => 'text', 'options' => array('label' => $this->translate('Company')))); $this->add(array('name' => 'email', 'options' => array('label' => $this->translate('Email')), 'attributes' => array('type' => 'text'))); $this->add(array('name' => 'password', 'type' => 'password', 'options' => array('label' => $this->translate('Password')), 'attributes' => array('type' => 'password'))); $this->add(array('name' => 'submit', 'type' => 'submit', 'attributes' => array('value' => $this->translate('Register')))); }
/** * @inheritdoc */ public function init() { parent::init(); $this->setAttribute('class', 'form-inline'); $this->add(array('name' => 'email', 'options' => array('glyphicon' => 'envelope', 'feedback' => TRUE), 'attributes' => array('type' => 'text', 'placeholder' => $this->translate('Email'), 'class' => 'form-control', 'id' => 'email'))); $this->add(array('name' => 'password', 'type' => 'password', 'options' => array('feedback' => TRUE, 'glyphicon' => 'lock'), 'attributes' => array('type' => 'password', 'placeholder' => $this->translate('Password'), 'class' => 'form-control', 'id' => 'password'))); $this->add(array('name' => 'remember_me', 'type' => 'checkbox', 'options' => array('use_hidden_element' => false, 'label' => $this->translate('Remember me'), 'label_options' => array('always_wrap' => true)))); $this->add(array('name' => 'csrf', 'type' => 'csrf')); $this->add(array('name' => 'submit', 'type' => 'submit', 'attributes' => array('value' => $this->translate('Sign in')))); }
/** * @inheritdoc */ public function init() { parent::init(); $this->setAttribute('class', 'form-horizontal'); $this->add(array('name' => 'title', 'type' => 'text', 'options' => array('label' => $this->translate('Title'), 'label_attributes' => array('class' => 'col-sm-1 control-label'), 'wrapper_class' => 'col-sm-10', 'help' => $this->translate('Article title')), 'attributes' => array('id' => 'title', 'class' => 'form-control'))); $this->add(array('name' => 'thumbnail', 'type' => 'imageFile', 'options' => array('label' => $this->translate('Thumbnail'), 'label_attributes' => array('class' => 'col-sm-1 control-label'), 'wrapper_class' => 'col-sm-10', 'help' => $this->translate('Article main image')), 'attributes' => array('id' => 'thumbnail', 'class' => 'js-upload-files'))); $this->add(array('name' => 'text', 'type' => 'textarea', 'options' => array('label' => $this->translate('Content'), 'label_attributes' => array('class' => 'col-sm-1 control-label'), 'wrapper_class' => 'col-sm-10', 'help' => $this->translate('Article main content')), 'attributes' => array('id' => 'editor', 'class' => 'form-control'))); $this->add(array('name' => 'author', 'type' => 'DoctrineModule\\Form\\Element\\ObjectSelect', 'options' => array('label' => $this->translate('Author'), 'label_attributes' => array('class' => 'col-sm-1 control-label'), 'wrapper_class' => 'col-sm-1', 'object_manager' => $this->getObjectManager(), 'target_class' => 'User\\Entity\\User', 'property' => 'fullName'), 'attributes' => array('id' => 'author', 'class' => 'form-control'))); $this->add((new Fieldset('actions'))->add(array('name' => 'submit', 'type' => 'submit', 'options' => array('disable_group_wrapper' => true), 'attributes' => array('value' => $this->translate('Save'), 'class' => 'btn btn-primary')))->setAttribute('class', 'form-group')->setOption('wrapper_class', 'col-sm-offset-1 col-sm-10 btn-group btn-group-lg')); }