Category "symfony"

Symfony DateTime format errors - datatransformation (external datepicker)

I'm working with Symfony 6 and a TempusDomini datepicker. I have read (amongst many others) the symfony documentation, https://symfony.com/doc/current/reference

Symfony - Dispatch event and listen in controller when route requested

I don't know if it's a good practice or what ever, but I would like to dispatch an event when an order is created, then I wish catch this event inside a control

Drop or Paste file on the Textarea

I want to make a message input like this. But I have a question how to get file data, which I drag & drop or Ctrl+V on the textarea to upload. I am using R

Symfony find user by role (JSON array Doctrine property)

I am doing a small project where I have an entity with a roles property which consists of an array. What I am trying to do is, in some controller, find an exist

Symfony / twig - Form with master-detail in it .. How to?

I'm coding a master detail page with Symfony 5 and twig I have table product, and another options When I create a product, I want to ask for name and have to ch

Symfony Test - Testing database with data to check Show($id) Feature

Could someone explain me how can I add some entities in to database for test purpose? I want to test that endpoint /show/{id} show correct response, but to chec

Twig: Unexpected token "name" of value "as" ("end of statement block" expected)

When i run a Twig Lint test localy using CLI on a file, i get no warning. But, my Gitlab pipeline returns a KO for the same file at the Twig-Lint stage: Unexpe

Inserting the current date doctrine

I have created a symfony project and am having a date issue. I would like to make a request which inserts the current date in the database. In my entity my fiel

Is it possible to change the way EasyAdmin load entities in index?

in my project with Symfony (PHP), i use EasyAdminBundle and i'm wondering if it's possible to change the way easyadmin load entities with pagination? I would li

When to use action injection and when to inject dependencies on the constructor for controllers?

In Symfony you can direct inject a service into a controller function: use App\Service\FooService; class FooController { public function one(FooService $fo

"Unable to find template" with Docker

I created a Symfony environment with Docker. I then included this file in my web project (skeleton website). But when I try to access my base.html.twig page loc

Symfony6 FindBy and entity many to many

I use symfony6 for the first time with php 8.0.17. I want to make a small form that allows me to retrieve "Card" objects. My "Card" objects are bound to many to

Database updates not readable while PHPunit WebTestCase (Symfony 5.1)

I have a problem asserting updates made by a form are really written in the database. I explain, I first do a create test (testCreateLactationForm), very simila

Unable to find "Proxies\__CG__\App\MyBundle\Entity\User" entity identifier associated with the UnitOfWork

I updated a Symfony project from version 3.4 to 5.3, and after that, I am getting the following error on some pages: Unable to find "Proxies\__CG__\App\MyBundle

Couldn't find constant subresourceOperations, class App\Entity\Comment

i have two table comment and author between them OneToMany relation, i want to display author of comment but it gives me error [Semantical Error] Couldn't find

401 Invalid JWT Token Lexik

I'm not sure why i Keep getting a wrong bearer token. { "code": 401, "message": "Invalid JWT Token" } When i debug it on https://jwt.io/ i also get a Invalid S

How can I prevent autologout of user in Symfony 4?

When the user uses my symfony application, then after a couple of minutes the user is automatically logged out, while he is working with the application. To pre

Deploy API Platform 2.6 and Symfony 5.4

I created a project with Api platform 2.6 & Symfony 5.4 and then I uploaded it with FileZilla (FTP). I followed the step to deploy a Symfonyproject update c

EasyAdmin: Error on change formTypeOptions property field in twig

I've an User entity and EasyAdmin (EA) UserCrudController for manage to them. The User entity has active boolean field. And I want that field will be disabled f

How create Nginx redirect if php send 404 error

i have a project and this project installed on few servers, he has one code, example: Server "A" => Project "A" Server "B" => Project "A" Project has bun