本文整理汇总了PHP中Venne\Forms\Form::addTags方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::addTags方法的具体用法?PHP Form::addTags怎么用?PHP Form::addTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Venne\Forms\Form
的用法示例。
在下文中一共展示了Form::addTags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configure
public function configure(Form $form)
{
$_this = $this;
$route = $form->addOne('route');
$group = $form->addGroup();
$route->setCurrentGroup($group);
$form->addText('name', 'Name');
$form->addText('price', 'Price')->setDefaultValue(0)->addCondition($form::FILLED)->addRule($form::FLOAT);
$form->addText('rrp', 'RRP')->addCondition($form::FILLED)->addRule($form::FLOAT);
$route->addTextArea('notation', 'Description');
$route->addFileEntityInput('photo', 'Image');
$form->addText('inStock', 'In stock')->addCondition($form::FILLED)->addRule($form::FLOAT);
$form->addGroup('');
$form->addManyToOne('category', 'Main category');
$form->addManyToMany('categories', 'Next categories');
$form->addGroup();
$form->addManyToMany('labels', 'Labels');
$tags = $form->addContainer('tags');
$tags->setCurrentGroup($group = $form->addGroup());
$form->addGroup('Types');
$form->addTags('typesAsArray', 'Types')->setSuggestCallback(function () use($_this, $form) {
$ret = array();
foreach ($_this->getTagsFromCategories($form) as $tag) {
$ret[$tag] = $tag;
}
return $ret;
})->setDelimiter('[;]+')->setJoiner(';');
$form->addGroup();
$form->addSaveButton('Save');
}
示例2: configure
public function configure(Form $form)
{
$route = $form->addOne('route');
$group = $form->addGroup();
$form->addText('name', 'Name');
$route->setCurrentGroup($group);
$route->addTextArea('description', 'Description')->getControlPrototype()->attrs['class'] = 'input-block-level';
$route->addFileEntityInput('photo', 'Photo');
$form->addManyToOne('parent', 'Parent');
//$form->addManyToMany('types', 'Types');
$form->addTags('typesAsArray', 'Types')->setDelimiter('[;]+')->setJoiner(';');
$form->addSaveButton('Save');
}