Guest User

Untitled

a guest
Aug 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. Custom Zend Form Decorator File no found
  2. class Core_Form extends Zend_Form
  3. {
  4.  
  5.  
  6. protected $_containerId;
  7. public function __construct($options = null) {
  8. parent::__construct($options);
  9.  
  10. $this->setElementDecorators(array(
  11. 'ViewHelper',
  12. array(
  13. 'Description',
  14. array(
  15. 'tag' => 'div',
  16. 'class' => 'submit-button',
  17. 'escape' => false
  18. )
  19. ),
  20. array(
  21. array(
  22. 'data' => 'HtmlTag'
  23. ),
  24. array(
  25. 'tag' => 'div',
  26. 'class' => 'element'
  27. )
  28. ),
  29. array(
  30. 'Label',
  31. array(
  32. 'tag' => 'div',
  33. 'escape' => false
  34. )
  35. ),
  36. array(
  37. array(
  38. 'row' => 'HtmlTag'
  39. ),
  40. array(
  41. 'tag' => 'div',
  42. 'class' => 'element-row'
  43. ),
  44. ),
  45. 'Errors'
  46. ));
  47.  
  48. $this->setDecorators(array(
  49. 'FormElements',
  50. array(
  51. 'HtmlTag',
  52. array(
  53. 'tag' => 'div',
  54. 'id' => $this->_containerId
  55. )
  56. ),
  57. 'Form',
  58. 'Errors'
  59. ));
  60. }
  61. }
  62. //upload form
  63. class Upload_Form extends Core_Form
  64. {
  65.  
  66. public function init()
  67. {
  68. /* Form Elements & Other Definitions Here ... */
  69.  
  70. $this->addElement('file', 'uploadFile', array(
  71. 'destination' => APPLICATION_PATH.'/../public/uploads/ads',
  72. 'validators' => array(
  73. array('count', false, 1),
  74. array('size', false, 102400),
  75. ),
  76. 'label' => 'Wyślij plik:'
  77. ));
  78.  
  79. $this->addElement('image', 'submit', array(
  80. 'label' => false,
  81. 'ignore' => true,
  82. 'src' => $this->getView()->baseUrl('images/send.jpg')
  83. ));
  84.  
  85. $this->setEnctype('multipart/form-data');
  86. }
  87.  
  88. }
Add Comment
Please, Sign In to add comment