Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  1. // UjhirdetesController.php
  2.  
  3. class UjhirdetesController extends Zend_Controller_Action
  4. {
  5.     /* ... */
  6.  
  7.     public function getAdatokForm($htipus){
  8.         return new Application_Form_UjHirdetesAdatok(array(
  9.                     'action' => SITE_PATH.'/ujhirdetes/adatokprocess',
  10.                     'method' => 'post',
  11.             'tipus' => $htipus
  12.             ));
  13.     }
  14.    
  15.     /* ... */
  16.  
  17.     public function adatokAction()
  18.     {
  19.         $form = $this->getAdatokForm(2);   
  20.         $this->view->form = $form;
  21.     }
  22.  
  23.     /* ... */
  24. }
  25.  
  26. // UjHirdetesAdatok.php
  27.  
  28. class Application_Form_UjHirdetesAdatok extends Zend_Form
  29. {
  30.     protected $tipus;
  31.        
  32.     public function init()
  33.     {
  34.         $tovabb = $this->addElement('submit', 'tovabb'.$this->getTipus(), array(
  35.                 'required' => false,
  36.                 'ignore'   => true,
  37.                 'label'    => 'Tovább',
  38.             ));
  39.            
  40.         $this->setDecorators(array(
  41.             array('viewScript', array('viewScript' => 'ujhirdetes/adatokForm.phtml'))
  42.         ));
  43.     }
  44.        
  45.     public function setTipus($hhtipus)
  46.     {
  47.         $this->_tipus = $hhtipus;
  48.     }
  49.        
  50.     public function getTipus()
  51.     {
  52.         return $this->_tipus;
  53.     }
  54. }
  55.  
  56. /*
  57. Message:
  58.  
  59. Only form elements and groups may be overloaded; variable of type "integer" provided
  60.  
  61. Stack trace:
  62.  
  63. #0 /var/www/dev.sigmanet.hu/ingatlanpark/application/forms/UjHirdetesAdatok.php(23): Zend_Form->__set('_tipus', 2)
  64. #1 /var/www/dev.sigmanet.hu/ingatlanpark/library/Zend/Form.php(372): Application_Form_UjHirdetesAdatok->setTipus(2)
  65. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement