|
|||
|
Hello,
I am new in ZF and have some question : I have a form : Code:
public static function Login()
{
require_once 'Zend/Form.php';
$LoginForm = new Zend_Form(
array(
'method' => 'post',
'elements' => array(
'LoginName' => array('text', array(
'required' => true,
'label' => 'Prisijungimo vardas'
)),
'Pass' => array('text', array(
'required' => true,
'label' => 'Slaptažodis'
)),
'submit' => array('submit', array(
'label' => 'Prisijungti'
))
),
));
return $LoginForm;
}
Code:
$form=$this->Login();
if ($this->getRequest()->isPost())
{
if ($form->isValid($_POST))
{
$values = $form->getValues();
}
/*else
{
$form->populate($_POST);
}*/
}
$this->view->form = $form;
How can I change this message, without creating a new class who extends Zend_Validate_Abstract? |
|
|||
|
Quote:
If so, you should use Zend_Translate. This might be of interest for you: Akra’s DevNotes Blog Archive Simple Zend_Form Example See comment 24-26. To get the error codes, you can use Code:
$this->getErrors() /friedhelm |
|
|||
|
Quote:
Code:
$element = new Zend_Form_Element(array(
'validators' => array(
array('NotEmpty', false, array(
'messages' => array('isEmpty' => 'This is a custom message')
)),
)
);
Nabble - Zend_Form The i18n-section of the docs (Zend Framework: Documentation) may help further. /friedhelm |
![]() |
| Thread Tools | |
| Display Modes | |
|
|