I’m a little confused as to the “right” way to retrieve the current session object within a controller in Symfony 5.3. The current documentation says to typehint an argument as SessionInterface. However, this Symfony blog post says SessionInterface has been deprecated in favor of using RequestStack. In services it’s clear that I should inject RequestStack and call $requestStack->getSession(). However, in
Tag: symfony5
Workflow in Symfony doesn’t work with “multiple_state”
In one of the configuration files of Symfony 5.2.8 with Workflow 5.2.7 I have: When I execute bin/console I have error: Unrecognized option “arguments” under framework.workflows.workflows.register_participation.marking_store”. Available options are “property”, “service”, “type”. When I change the configuration to: I get the error: The value “multiple_state” is not allowed for path framework.workflows.workflows.register_participation.marking_store.type”. Permissible values: “method” It works when I change to
disable symfony 5 database connection
I have the default config in my symfonu project I have this line at .env file and I get this error Of course I dont have not isntalled postgres, and I dont need a database for this project, How I cant fix this error I tried to comment the .env file line but I get another error Answer Commenting the
How to get the status of the production server symfony [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed last year. Improve this question When starting the server locally I executed the command symfony server:prod using the Symfony
Where is the preload.php file, and how is it generated?
With Symfony 5.1 and PHP 7.4, I want to add preload.php in opcache. Symfony documentation : During container compilation (e.g. when running the cache:clear command), Symfony generates a file called preload.php in the config/ directory with the list of classes to preload. opcache.preload=/path/to/project/config/preload.php But when I execute cache:clear, I don’t have preload.php file in /config/ directory. After search on google,
How to use Vich uploader with easyAdmin 3 on Symfony 5
I’ve been trying to use VichUploader to upload files on a Symfony project, already using EasyAdmin 3. I’ve configured everything correctly, but I’m getting this error: The “pieceJointeFile” image field must define the directory where the images are uploaded using the setUploadDir() method. vich uploader configuration and finally My crud controller Finally, I want to clarify that when using TextField it
Why isn’t InteractiveLoginEvent not fired with Symfony’s 5.1 new security system?
With the new Symfony 5.1 security system, I’m not able to fire the InteractiveLoginEvent. I followed the configuration in the official documentation (here and here) and the system was working …
Can’t debug with Symfony CLI / Xdebug
I am running my server with symfony server:start command and I would like to debug it as usual with PHP remote debug provided by PhpStorm. I’ve configured my Xdebug with these: I have installed the debugtool for my browser and configured my server in the PHP remote debug window. When I’m trying to debug my IDE is breaking in the
easyadmin 3 – Sorting by linked entity’s property instead of id
I have one entity Hike which have relation with another named Department In easyAdmin3 rendering is fine like But when I sorting by department I see that easyAdmin3 sort by department’s id, and I would like sorting by department_nom I saw many solutions but they all using easyAdmin2 and easy_admin.yaml which no longer exists now. There is a way to
symfony 5.1: how to define a controller as a service
I’m a bit of a noob when it comes to Symfony. I am attempting to create a bundle with a controller that accepts a service as a constructor argument; however, I am receiving this error: The controller …