示例#1
0
文件: Login.php 项目: utrenkner/YAWIK
 public function __construct($name = 'login-form', $options = array())
 {
     parent::__construct($name, $options);
     $this->setAttribute('data-handle-by', 'native');
     $this->setAttribute('class', 'form-inline');
     $fieldset = new Fieldset('credentials');
     $fieldset->setOptions(array('renderFieldset' => true));
     $fieldset->add(array('name' => 'login', 'options' => array('id' => 'login', 'label' => 'Login name')));
     $fieldset->add(array('type' => 'password', 'name' => 'credential', 'options' => array('id' => 'credential', 'label' => 'Password')));
     $this->add($fieldset);
     $buttons = new \Core\Form\ButtonsFieldset('buttons');
     $buttons->add(array('type' => 'submit', 'name' => 'button', 'attributes' => array('id' => 'submit', 'type' => 'submit', 'value' => 'login', 'class' => 'btn btn-primary')));
     $this->add($buttons);
 }
 public function init()
 {
     $this->setName('login-form');
     $this->setAttribute('data-handle-by', 'native');
     $fieldset = new Fieldset('credentials');
     //$fieldset->setLabel('Enter your credentials');
     $fieldset->setOptions(array('renderFieldset' => true));
     $fieldset->add(array('name' => 'login', 'options' => array('label' => 'Login name')));
     $fieldset->add(array('type' => 'password', 'name' => 'credential', 'options' => array('label' => 'Password')));
     $this->add($fieldset);
     $buttons = new \Core\Form\ButtonsFieldset('buttons');
     $buttons->add(array('type' => 'submit', 'name' => 'button', 'attributes' => array('id' => 'submit', 'type' => 'submit', 'value' => 'login', 'class' => 'btn btn-primary')));
     $this->add($buttons);
 }