Answer the question
In order to leave comments, you need to log in
Whether it is admissible to use pieces of View in Controller?
Good afternoon!
When studying Symphony, the following question arose: is it permissible to operate the display in the controller?
For example, in Symfony Forms , when creating a form, not only logic is written in it, but also its display:
$form = $this->createFormBuilder($task)
->add('task', TextType::class)
->add('dueDate', DateType::class)
->add('save', SubmitType::class, ['label' => 'Create Task']) // - лейбл - это уже часть шаблона, верно?
->getForm();
$builder->add('body', TextareaType::class, [
'attr' => ['class' => 'tinymce'],
]);
<?php $form->render( [
'field' => [
'class' => 'tinymce',
'label' => 'Лейбл для поля',
...
], ...
] ); ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question