HosipLan

Untitled

Sep 11th, 2012
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class presenter
  2. {
  3.     protected function createComponentMyForm()
  4.     {
  5.         return new MyFormControl;
  6.     }
  7. }
  8.  
  9. class MyFormControl extends UI\Control
  10. {
  11.     public function render()
  12.     {
  13.         $this->template->form = $this['form'];
  14.         $this->template->setFile(__DIR__ . '/MyFormControl.latte');
  15.         $this->template->render();
  16.     }
  17.  
  18.  
  19.     protected function createComponentForm()
  20.     {
  21.         $form = new UI\Form;
  22.         $form->addText(...);
  23.         return $form;
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment