本文整理汇总了PHP中Venne\Forms\Form::getUniqueId方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::getUniqueId方法的具体用法?PHP Form::getUniqueId怎么用?PHP Form::getUniqueId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Venne\Forms\Form
的用法示例。
在下文中一共展示了Form::getUniqueId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addMailform
/**
* @param Form $form
* @param $name
* @return \DoctrineModule\Forms\Containers\EntityContainer
*/
public function addMailform($form, $name)
{
/** @var $container Form */
$container = $form->addOne($name);
$container->setCurrentGroup($form->addGroup('Sender'));
$container->addCheckbox('sendCopyToSender', 'Send copy to sender')->addCondition($form::EQUAL, true)->toggle('copyHeader')->toggle('copyRecipient');
$container->setCurrentGroup($group = $form->addGroup());
$group->setOption('id', 'copyHeader');
$container->addTextArea('copyHeader', 'Header of copy')->getControlPrototype()->attrs['class'] = 'input-block-level';
$container->setCurrentGroup($form->addGroup('Recipient'));
$container->addTags('emails', 'E-mails')->addRule($form::FILLED, 'Please set e-mail.');
$container->setCurrentGroup($group = $form->addGroup());
$group->setOption('id', 'copyRecipient');
$container->addText('recipient', 'Recipient name')->addConditionOn($container['sendCopyToSender'], $form::EQUAL, true)->addRule($form::FILLED, 'Please set recipient name.');
$container->setCurrentGroup($group = $form->addGroup());
$container->addText('subject', 'Subject')->addRule($form::FILLED, 'Please set subject.');
$container->addCheckbox('ownTemplate', 'Advanced options')->addCondition($form::EQUAL, true)->toggle('template');
$container->setCurrentGroup($group = $form->addGroup());
$group->setOption('id', 'template');
$container->addTextarea('template', 'Mail template')->getControlPrototype()->attrs['class'] = 'input-block-level';
$container->setCurrentGroup($group = $form->addGroup('Inputs'));
$mainContainer = $container;
/** @var $items \Nette\Forms\Container */
$items = $container->addMany('inputs', function (\Nette\Forms\Container $container) use($group, $form, $mainContainer) {
$container->setCurrentGroup($group);
$container->addText('label', 'Label');
$container->addSelect('type', 'Type', InputEntity::getTypes())->addCondition($form::IS_IN, array(InputEntity::TYPE_CHECKBOX_LIST, InputEntity::TYPE_RADIO_LIST, InputEntity::TYPE_SELECT))->toggle("frm{$form->getUniqueId()}-{$mainContainer->getName()}-inputs-{$container->getName()}-items-pair")->endCondition()->addCondition($form::IS_IN, array(InputEntity::TYPE_CHECKBOX, InputEntity::TYPE_TEXT, InputEntity::TYPE_TEXTAREA, InputEntity::TYPE_CHECKBOX_LIST, InputEntity::TYPE_RADIO_LIST, InputEntity::TYPE_SELECT))->toggle("frm{$form->getUniqueId()}-{$mainContainer->getName()}-inputs-{$container->getName()}-required-pair");
$container->addTags('items', 'Items');
$container->addCheckbox('required', 'Required');
$container->addSubmit('remove', 'Remove input')->addRemoveOnClick();
});
$items->setCurrentGroup($group = $form->addGroup());
$items->addSubmit('add', 'Add input')->setValidationScope(FALSE)->addCreateOnClick();
}