HosipLan

Untitled

Aug 5th, 2011
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1.     protected function createComponentMyForm()
  2.     {
  3.         $form = new Nette\Application\UI\Form;
  4.         $presenter = $this;
  5.  
  6.         $products = $form->addDynamic('products', function (Container $container) use ($presenter) {
  7.             $container->addText('pocet', 'Pocet');
  8.             $container->addSubmit('buy', 'Koupit')
  9.                 ->onClick[] = callback($presenter, 'Buy');
  10.         }, 0);
  11.  
  12.         // kontejnery vytvoř v továrničce! do toho je to továrnička
  13.         foreach($this->model->products as $product)
  14.         {
  15.             $products->createOne($product->id);
  16.         }
  17.  
  18.         return $form;
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment