Reputation: 45
According to the above link I can create a form element in the view like so
echo $this->formText($name, $value, $attribs);
However how would I apply validation or does this need to be done in the controller using the validator component?
Upvotes: 3
Views: 285
Reputation: 11217
Better solution is to use complete Zend_Form class to create the form and validate it.
Upvotes: 0
Reputation: 18440
If you did this:-
<form action='/login'>
echo $this->formText($name, $value, $attribs);
echo $this->formSubmit($name, $value, $attribs);
</form>
Then you would carry out the validation in the indexAction of your login controller using the validators available in Zend Validate.
Using this method you probably won't have a form object and I wouldn't really recommend using it unless you really don't like Zend Form.
So, basically that was just a long winded way of saying 'Yes this needs to be done in the controller using the validator component'.
Upvotes: 4