|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace PiouPiou\RibsAdminBundle\Form; |
|
4
|
|
|
|
|
5
|
|
|
use Symfony\Component\Form\AbstractType; |
|
6
|
|
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; |
|
7
|
|
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType; |
|
8
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType; |
|
9
|
|
|
use Symfony\Component\Form\FormBuilderInterface; |
|
10
|
|
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
|
11
|
|
|
|
|
12
|
|
|
class Package extends AbstractType |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* @param FormBuilderInterface $builder |
|
16
|
|
|
* @param array $options |
|
17
|
|
|
*/ |
|
18
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options) |
|
19
|
|
|
{ |
|
20
|
|
|
$builder |
|
21
|
|
|
->add("projectName", TextType::class, [ |
|
22
|
|
|
"label" => "Project name" |
|
23
|
|
|
]) |
|
24
|
|
|
->add("projectUrl", TextType::class, [ |
|
25
|
|
|
"label" => "Project url", |
|
26
|
|
|
"required" => true |
|
27
|
|
|
]) |
|
28
|
|
|
->add("packageName", TextType::class, [ |
|
29
|
|
|
"label" => "Package name" |
|
30
|
|
|
]) |
|
31
|
|
|
->add("checkVersionUrl", TextType::class, [ |
|
32
|
|
|
"label" => "Check version url", |
|
33
|
|
|
"required" => false |
|
34
|
|
|
]) |
|
35
|
|
|
->add("composerLockUrl", TextType::class, [ |
|
36
|
|
|
"label" => "Check composer.lock url", |
|
37
|
|
|
"required" => false |
|
38
|
|
|
]) |
|
39
|
|
|
->add('isLocal', CheckboxType::class, [ |
|
40
|
|
|
'label' => 'Is local project', |
|
41
|
|
|
'attr' => [ |
|
42
|
|
|
'class' => 'ribs-checkbox switched' |
|
43
|
|
|
], |
|
44
|
|
|
'required' => false |
|
45
|
|
|
]) |
|
46
|
|
|
->add('submit', SubmitType::class, [ |
|
47
|
|
|
'label' => 'Validate', |
|
48
|
|
|
'attr' => [] |
|
49
|
|
|
]); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @param OptionsResolver $resolver |
|
54
|
|
|
*/ |
|
55
|
|
|
public function configureOptions(OptionsResolver $resolver) |
|
56
|
|
|
{ |
|
57
|
|
|
$resolver->setDefaults([ |
|
58
|
|
|
"data_class" => \PiouPiou\RibsAdminBundle\Entity\Package::class, |
|
59
|
|
|
]); |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|