Symfony4 how to create a custom error page 404

Code sur écran d'ordinateur

You have to start by installing the necessary bundle: compose require symfony/twig-pack When done, create the template error404.html.twig templates/ Bundles/ TwigBundle/ Exception/ Error404.html.twig Example of the error404.html.twig template ‘% extends ‘base.html.twig’ %’ ‘% block body%’ <h1>Page not found</h1> <p> The requested page couldn’t be located. Checkout for any URL misspelling or <a href=”{{ path(‘homepage’) }}”>return … Read more

Upload multiple files to an entity with Symfony4 and VichUploaderBundle

Code sur écran d'ordinateur

Preparation   To begin with, we need a Product entity as well as a ProductImage entity that will contain the names of the images. To do this, we use the command in our terminal VichUploaderBundle Setup As stated in the Symfony 4 documentation, we will use the VichUploaderBundle Then add the necessary “config/packages/vich_uploader.yaml” configuration file … Read more