mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
fix deprecations: use fqcn
This commit is contained in:
parent
16b05d29e5
commit
24357ce3d6
@ -63,7 +63,7 @@ class ScopeController extends Controller
|
|||||||
*/
|
*/
|
||||||
private function createCreateForm(Scope $scope)
|
private function createCreateForm(Scope $scope)
|
||||||
{
|
{
|
||||||
$form = $this->createForm(new ScopeType(), $scope, array(
|
$form = $this->createForm(ScopeType::class, $scope, array(
|
||||||
'action' => $this->generateUrl('admin_scope_create'),
|
'action' => $this->generateUrl('admin_scope_create'),
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
));
|
));
|
||||||
@ -80,7 +80,7 @@ class ScopeController extends Controller
|
|||||||
public function newAction()
|
public function newAction()
|
||||||
{
|
{
|
||||||
$scope = new Scope();
|
$scope = new Scope();
|
||||||
$form = $this->createCreateForm($scope);
|
$form = $this->createCreateForm($scope);
|
||||||
|
|
||||||
return $this->render('ChillMainBundle:Scope:new.html.twig', array(
|
return $this->render('ChillMainBundle:Scope:new.html.twig', array(
|
||||||
'entity' => $scope,
|
'entity' => $scope,
|
||||||
@ -138,12 +138,12 @@ class ScopeController extends Controller
|
|||||||
*/
|
*/
|
||||||
private function createEditForm(Scope $scope)
|
private function createEditForm(Scope $scope)
|
||||||
{
|
{
|
||||||
$form = $this->createForm(new ScopeType(), $scope, array(
|
$form = $this->createForm(ScopeType::class, $scope, array(
|
||||||
'action' => $this->generateUrl('admin_scope_update', array('id' => $scope->getId())),
|
'action' => $this->generateUrl('admin_scope_update', array('id' => $scope->getId())),
|
||||||
'method' => 'PUT',
|
'method' => 'PUT',
|
||||||
));
|
));
|
||||||
|
|
||||||
$form->add('submit', 'submit', array('label' => 'Update'));
|
$form->add('submit', SubmitType::class, array('label' => 'Update'));
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ namespace Chill\MainBundle\Form\Type;
|
|||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Translation\Translator;
|
use Symfony\Component\Translation\Translator;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
|
|
||||||
class TranslatableStringFormType extends AbstractType
|
class TranslatableStringFormType extends AbstractType
|
||||||
{
|
{
|
||||||
@ -22,7 +23,7 @@ class TranslatableStringFormType extends AbstractType
|
|||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options) {
|
public function buildForm(FormBuilderInterface $builder, array $options) {
|
||||||
foreach ($this->availableLanguages as $lang) {
|
foreach ($this->availableLanguages as $lang) {
|
||||||
$builder->add($lang, 'text',
|
$builder->add($lang, TextType::class,
|
||||||
array('required' => (in_array($lang,
|
array('required' => (in_array($lang,
|
||||||
$this->frameworkTranslatorFallback))));
|
$this->frameworkTranslatorFallback))));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user