Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Custom Zend Form Decorator File no found
- class Core_Form extends Zend_Form
- {
- protected $_containerId;
- public function __construct($options = null) {
- parent::__construct($options);
- $this->setElementDecorators(array(
- 'ViewHelper',
- array(
- 'Description',
- array(
- 'tag' => 'div',
- 'class' => 'submit-button',
- 'escape' => false
- )
- ),
- array(
- array(
- 'data' => 'HtmlTag'
- ),
- array(
- 'tag' => 'div',
- 'class' => 'element'
- )
- ),
- array(
- 'Label',
- array(
- 'tag' => 'div',
- 'escape' => false
- )
- ),
- array(
- array(
- 'row' => 'HtmlTag'
- ),
- array(
- 'tag' => 'div',
- 'class' => 'element-row'
- ),
- ),
- 'Errors'
- ));
- $this->setDecorators(array(
- 'FormElements',
- array(
- 'HtmlTag',
- array(
- 'tag' => 'div',
- 'id' => $this->_containerId
- )
- ),
- 'Form',
- 'Errors'
- ));
- }
- }
- //upload form
- class Upload_Form extends Core_Form
- {
- public function init()
- {
- /* Form Elements & Other Definitions Here ... */
- $this->addElement('file', 'uploadFile', array(
- 'destination' => APPLICATION_PATH.'/../public/uploads/ads',
- 'validators' => array(
- array('count', false, 1),
- array('size', false, 102400),
- ),
- 'label' => 'Wyślij plik:'
- ));
- $this->addElement('image', 'submit', array(
- 'label' => false,
- 'ignore' => true,
- 'src' => $this->getView()->baseUrl('images/send.jpg')
- ));
- $this->setEnctype('multipart/form-data');
- }
- }
Add Comment
Please, Sign In to add comment