当前位置: 首页>>代码示例>>PHP>>正文


PHP Form::getUniqueId方法代码示例

本文整理汇总了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();
 }
开发者ID:svobodni,项目名称:web,代码行数:39,代码来源:MailformExtension.php


注:本文中的Venne\Forms\Form::getUniqueId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。