?
<?php
//class FormLogin extends My_Form_Uni
class FormLoginadmin extends Zend_Form
{
public function __construct($options = null)
{
parent::__construct($options);
$this->setName('formlogin');
$session = Zend_Registry::get('session');
$translate = Zend_Registry::get('translate');
$decoratorConnection = new Decorator_Connection();
$decoratorLogin = new Decorator_Login();
$valid = new Zend_Validate_NotEmpty();
$decoratorscellule = array(
'ViewHelper',
'Errors',
);
$decoratorsSubmit = array(
'ViewHelper',
'Errors',
);
//login
$decoratorsLogin= array(
'ViewHelper',
'Errors',
array('Description', array('tag' => 'p', 'class' => 'description')),
array('HtmlTag', array('tag' => 'li')),
array('Label', array('tag' => 'li','class' => 'label')),
array(array('ul' => 'HtmlTag'), array('tag' => 'ul')),
array(array('div' => 'HtmlTag'), array('tag' => 'div', 'id' => 'lignelogin'))
);
$this->addElement(
'text',
'login',
array(
'decorators' => $decoratorscellule,
'validators' => array($valid),
'placeholder' => $translate->_("label_user"),
'value' => '',
'class' => 'form-control',
'required' => true,
'aria-describedby' => "basic-addon1",
'ErrorMessages' => array(Zend_Validate_NotEmpty::IS_EMPTY => ($translate->_("error-obligatoire"))))
);
$this->addElement(
'password',
'pass',
array(
'decorators' => $decoratorscellule,
'validators' => array($valid),
'placeholder' => $translate->_("label_password"),
'value' => '',
'class' => 'form-control',
'required' => true,
'aria-describedby' => "basic-addon2",
'ErrorMessages' => array(Zend_Validate_NotEmpty::IS_EMPTY => ($translate->_("error-obligatoire"))))
);
$this->addElement(
'submit',
'submit',
array(
'decorators' => $decoratorscellule,
'label' => $translate->_("admin_bouton_login"),
'value' => 'ok',
'class' => 'btn btn-primary btn-lg',
)
);
//$connectionblock = new Zend_Form_Element('connection', array('label' => '','id'=>'', 'id'=>'test', 'decorators' => array($decoratorConnection),));
//$loginblock = new Zend_Form_Element('login', array('label' => '','id'=>'bar', 'decorators' => array($decoratorLogin),));
$pagelogin = new Zend_Form_Element_Hidden('pagelogin');
$pagelogin->setName('pagelogin');
$pagelogin->setValue("ok");
$this->addDecorator('HtmlTag', array('tag' => 'div', 'id' => 'blocklogin'));
$pagelogin->removeDecorator('Label');
$pagelogin->removeDecorator('HtmlTag');
//$material->setAttrib('onchange','document.getElementById("formPage").submit();');
$this->addElements(array($pagelogin));
}
}