Answer the question
In order to leave comments, you need to log in
How to fix bug in Symfony 5.0 An exception has been thrown during the rendering of a template?
I decided to create a simple application on 5.0.0:
symfony new my_project_name --full
composer dump-env dev
echo "7.2" > .php-version
(the server did not work on 7.0) php bin/console make:entity
(added one field - sting for example) php bin/console make:crud
Answer the question
In order to leave comments, you need to log in
The problem is in the maker-bundle (not tied to the Symfony version). It doesn't create a __toString magic method to display entities. You need to add it yourself:
public function __toString()
{
return $this->name;
}
\Symfony\Component\Form\Extension\Core\Type\ColorType
in which, apparently, your essence is cast into a string. \App\Form\ColorType
method in the class getBlockPrefix
and everything will work:public function getBlockPrefix()
{
return 'app_color';
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question