HosipLan

Untitled

Aug 26th, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. class CreateOrEditUserFormFactory extends Nette\Object
  2. {
  3.         private $foo;
  4.  
  5.         public function __construct($foo)
  6.         {
  7.                 $this->foo = $foo;
  8.         }
  9.  
  10.         public function createForm()
  11.         {
  12.                 $form = new Form;
  13.                 ...
  14.  
  15.                 $form->addSubmit('send', 'Update Account');
  16.                 $form->addSubmit('sendandview', 'Update Account and continue editing')
  17.                         ->onClick[] = $this->process;
  18.  
  19.                 return $form;
  20.         }
  21.  
  22.     public function createAdminForm()
  23.     {
  24.         $form = $this->createForm();
  25.         $form->addPassword();
  26.         return $form;
  27.     }
  28.  
  29.         public function process($button)
  30.         {
  31.                 ...
  32.         }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment