HosipLan

Untitled

Mar 31st, 2011
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. class MyForm extends Nette\Application\AppForm
  2. {
  3.  
  4.     public function __construct(Nette\ComponentContainer $parent, $name)
  5.     {
  6.         parent::__construct($parent, $name);
  7.  
  8.         $this->addText(...
  9.         $this->addSelect(...
  10.         $form->addSubmit(...
  11.     }
  12.  
  13. }
  14.  
  15. // ...
  16.  
  17. protected function createComponentMyForm($name)
  18. {
  19.     return new MyForm();
  20. }
  21.  
  22.  
  23. ####### ... nebo containery
  24.  
  25. class MyContainer extends Nette\Forms\FormContainer
  26. {
  27.    
  28.     public function __construct()
  29.     {
  30.         parent::__construct();
  31.  
  32.         $this->addText(...
  33.         $this->addSelect(...
  34.     }
  35.    
  36. }
  37.  
  38. // ...
  39.  
  40. protected function createComponentMyForm($name)
  41. {
  42.     $form = new Nette\Application\AppForm($this, $name);
  43.     $form['neco'] = new MyContainer;
  44.  
  45.     $form->addSubmit(...
  46. }
Advertisement
Add Comment
Please, Sign In to add comment