forked from mautic/mautic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConfigType.php
50 lines (45 loc) · 1.45 KB
/
ConfigType.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/*
* @copyright 2014 Mautic Contributors. All rights reserved
* @author Mautic
*
* @link http://mautic.org
*
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
namespace Mautic\ReportBundle\Form\Type;
use Mautic\CoreBundle\Form\Type\YesNoButtonGroupType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
class ConfigType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('csv_always_enclose', YesNoButtonGroupType::class, [
'label' => 'mautic.config.tab.form.csv_always_enclose',
'label_attr' => ['class' => 'control-label'],
'attr' => [
'class' => 'form-control',
'tooltip' => 'mautic.config.tab.form.csv_always_enclose.tooltip',
],
'data' => isset($options['data']['csv_always_enclose']) ? (bool) $options['data']['csv_always_enclose'] : false,
'constraints' => [
new NotBlank([
'message' => 'mautic.core.value.required',
]),
],
]);
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'reportconfig';
}
}