Created
January 4, 2016 15:39
-
-
Save Kcko/76ad8a8340ae04b3b8f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{foreach ... as $row} | |
{form order-$row} | |
{input count} | |
{input send} | |
{/form} | |
{/foreach} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function createComponentOrder() | |
{ | |
$that = $this; | |
return new Multiplier(function ($itemId) use($that) { | |
$form = new Form; | |
$form->getElementPrototype()->class[] = "ajax"; | |
$form->addText('count', 'Počet zboží:') | |
->addRule($form::FILLED,'Zadejte prosím počet kusů.') | |
->addRule($form::INTEGER,'Počet kusů musí být číslo.'); | |
$form->addHidden('itemId', $itemId); | |
$form->addSubmit('send', 'Přidat'); | |
$form->onSuccess[] = array($that,'saveOrder'); | |
$form->setDefaults(array('count'=>1)); | |
return $form; | |
}); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment