How do I use viewscripts on zend_form file elements?
Answer Posted / Arun Kumar Verma
To use view scripts with Zend_Form elements, you can create a separate view script for the form element and set its path as the decorator's viewScript option. Here's an example:
```php
$element = new Zend_Form_Element_Text('username');
// Set the view script path
$element->setDecorators(array(
array('ViewScript', array('viewScript' => 'user/form/username.phtml'))
));
```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers