本文整理汇总了PHP中FormBuilder::add方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::add方法的具体用法?PHP FormBuilder::add怎么用?PHP FormBuilder::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormBuilder
的用法示例。
在下文中一共展示了FormBuilder::add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: appendToForm
/**
* @param FormBuilder|Form $builder
*/
public function appendToForm(&$builder, $data, $formArea)
{
if ($formArea == 'features') {
$name = strtolower($this->getName());
if ($this->factory->serviceExists('mautic.form.type.cloudstorage.' . $name)) {
$builder->add('provider', 'cloudstorage_' . $name, ['label' => 'mautic.integration.form.provider.settings', 'required' => false, 'data' => isset($data['provider']) ? $data['provider'] : []]);
}
}
}
示例2: buildForm
public function buildForm(FormBuilder $builder, array $options)
{
$builder->add('keyword', 'text', array('label' => 'Mot-clé'));
}
示例3: appendToForm
/**
* @param \Mautic\PluginBundle\Integration\Form|FormBuilder $builder
* @param array $data
* @param string $formArea
*/
public function appendToForm(&$builder, $data, $formArea)
{
if ($formArea == 'features') {
$builder->add('sandbox', 'choice', ['choices' => ['sandbox' => 'mautic.salesforce.sandbox'], 'expanded' => true, 'multiple' => true, 'label' => 'mautic.salesforce.form.sandbox', 'label_attr' => ['class' => 'control-label'], 'empty_value' => false, 'required' => false, 'attr' => ['onclick' => 'Mautic.postForm(mQuery(\'form[name="integration_details"]\'),\'\');']]);
$builder->add('objects', 'choice', ['choices' => ['Lead' => 'mautic.salesforce.object.lead', 'Contact' => 'mautic.salesforce.object.contact', 'Activity' => 'mautic.salesforce.object.activity'], 'expanded' => true, 'multiple' => true, 'label' => 'mautic.salesforce.form.objects_to_pull_from', 'label_attr' => ['class' => ''], 'empty_value' => false, 'required' => false]);
$builder->add('namespace', 'text', ['label' => 'mautic.salesforce.form.namespace_prefix', 'label_attr' => ['class' => 'control-label'], 'attr' => ['class' => 'form-control'], 'required' => false]);
}
}
示例4: buildForm
public function buildForm(FormBuilder $builder, array $options)
{
$builder->add('file', 'file');
}