fix deprecations: use fqcn

This commit is contained in:
nobohan 2018-04-05 15:23:29 +02:00
parent 0f1c4d1120
commit 4c4f4b5ca7
2 changed files with 9 additions and 4 deletions

View File

@ -4,9 +4,12 @@ namespace Chill\CustomFieldsBundle\Controller;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Chill\CustomFieldsBundle\Entity\CustomField; use Chill\CustomFieldsBundle\Entity\CustomField;
use Chill\CustomFieldsBundle\Form\CustomFieldType; use Chill\CustomFieldsBundle\Form\CustomFieldType;
/** /**
* CustomField controller. * CustomField controller.
* *
@ -62,7 +65,7 @@ class CustomFieldController extends Controller
'group_widget' => ($entity->getCustomFieldsGroup()) ? 'hidden' :'entity' 'group_widget' => ($entity->getCustomFieldsGroup()) ? 'hidden' :'entity'
)); ));
$form->add('submit', 'submit', array('label' => 'Create')); $form->add('submit', SubmitType::class, array('label' => 'Create'));
return $form; return $form;
} }
@ -154,7 +157,7 @@ class CustomFieldController extends Controller
'group_widget' => 'hidden' 'group_widget' => 'hidden'
)); ));
$form->add('submit', 'submit', array('label' => 'Update')); $form->add('submit', SubmitType::class, array('label' => 'Update'));
return $form; return $form;
} }

View File

@ -5,6 +5,8 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Chill\MainBundle\Form\Type\TranslatableStringFormType;
@ -26,10 +28,10 @@ class ChoicesListType extends AbstractType
$locales = $this->defaultLocales; $locales = $this->defaultLocales;
$builder->add('name', TranslatableStringFormType::class) $builder->add('name', TranslatableStringFormType::class)
->add('active', 'checkbox', array( ->add('active', CheckboxType::class, array(
'required' => false 'required' => false
)) ))
->add('slug', 'hidden', array( ->add('slug', HiddenType::class, array(
)) ))
->addEventListener(FormEvents::SUBMIT, function(FormEvent $event) use ($locales){ ->addEventListener(FormEvents::SUBMIT, function(FormEvent $event) use ($locales){