Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected function createComponentMyForm()
- {
- $form = new Nette\Application\UI\Form;
- $presenter = $this;
- $products = $form->addDynamic('products', function (Container $container) use ($presenter) {
- $container->addText('pocet', 'Pocet');
- $container->addSubmit('buy', 'Koupit')
- ->onClick[] = callback($presenter, 'Buy');
- }, 0);
- // kontejnery vytvoř v továrničce! do toho je to továrnička
- foreach($this->model->products as $product)
- {
- $products->createOne($product->id);
- }
- return $form;
- }
Advertisement
Add Comment
Please, Sign In to add comment