Questions tagged [symfony6]

Use this tag for questions addressing particular features of the PHP framework Symfony in version 6. Otherwise use only the general [symfony] tag plus the language tag [php].

Symfony is a framework for web and CLI-applications built on top of a catalog of Symfony components. It is free software released under the MIT license. The project's homepage is symfony.com.

Symfony 6 was released in November 2021 and includes several changes compared to its predecessor. However there are no new features compared to version 5.4.

429 questions
0
votes
1 answer

Render twig template in Sonata-Admin Bulk-Action: You cannot use the "renderView"

I created a Sonata Admin-Class which I also added a customized Batch-Action: protected function configureBatchActions(array $actions): array { $actions = parent::configureBatchActions($actions); $actions['compareConfig'] = [ …
Atreides78
  • 577
  • 1
  • 7
  • 22
0
votes
1 answer

JWT Authentification invalid Credentials with the token

I am new to Symfony and jwt Authentication. I tried to set up an access to api platform resources with a jwt token. I followed the doc https://symfony.com/bundles/LexikJWTAuthenticationBundle/current/index.html to set up the token. My problem comes…
0
votes
0 answers

Symfony CLI doesn't find all the php versions on my system

I created a Symfony 6 project locally on my PC (Windows 11 Entreprise v.21H2) and I want to use a specific version of PHP. I know that we can use different versions by creating a .php-version file in the project root. So I did this command symfony…
Eve
  • 776
  • 2
  • 11
  • 32
0
votes
0 answers

Symfony6, EasyAdmin4, problem while saving a new item in database from the EasyAdmin Interface

I can't add a new Item via my EasyAdmin4 (with Symfony 6).. I fill the fields, click on create to add it in DB.. but instead I got this: HTTP 500 Internal Server Error: RouteNotFoundException Unable to generate a URL for the named route "app_login"…
Khalid M.
  • 1
  • 1
0
votes
0 answers

API Platform: Apply a filter to multiple resources

I'm trying to apply SearchFilter to multiple resources. Let's imagine I've got two resources: Post and Article (just for the illustration): #[ApiRsource] class Post { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id =…
Nel
  • 454
  • 5
  • 14
0
votes
1 answer

How to customise select tags in a form in Symfony

I try to display a form with Symfony. In the form, I am asking for birthdate ans I would like to give a class to select which is in a form widget. At the moment, I just could give class to form widget itself. How do I can do it ? {% extends…
Emilie Tossan
  • 127
  • 1
  • 1
  • 16
0
votes
1 answer

How can I insert checkbox in a form with Symfony

I'd like to insert a checkbox in my form with Symfony. I used CheckboxType in my UserType.php file for field "role". I would like to set the value "ROLE_ADMIN" for when the checkbox is checked. The value of a checkbox is a boolean and at the moment…
Emilie Tossan
  • 127
  • 1
  • 1
  • 16
0
votes
1 answer

Symfony and DoctrineBehavior/translatable with two default locales?

I'm looking for an elegant way to have the following behavior in Symfony 6. I use DoctrineBehaviors/translatable to store some fields in several languages, let's say 'en', 'fr' and 'de'. The users have a small dropdown on my navbar, with which they…
Ryierth
  • 38
  • 1
  • 7
0
votes
1 answer

API Platform : Custom setter methods don't work

I'm trying to set up an ApiRessource using API Platform. Here is my Cheese entity: #[ORM\Entity(repositoryClass: CheeseListingRepository::class)] #[ApiResource] class CheeseListing { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] …
Nel
  • 454
  • 5
  • 14
0
votes
1 answer

Symfony 6 global functions.php causes exception

I get Expected to find class "App\Helper\dj_functions" in file "/home/myuser/IdeaProjects/myproject/symfony/src/Helper/dj_functions.php" while importing services from resource "../src/", but it was not found! Check the namespace prefix used with…
Toskan
  • 13,911
  • 14
  • 95
  • 185
0
votes
0 answers

SQLSTATE connection refused while creating database

I am stuck with this error while trying to create a database on Symfony 6: An exception occured in the driver: SQLSTATE[HY000] [2002] Connection refused I am on macOs, using MAMP.
0
votes
1 answer

Symfony - how to access table data from link table

I have a user table, a module table, and a user_module binding table. The user_module table has user_id and module_id as foreign keys, and an is_activated attribute. When I fetch a row from the slugs of the user and module tables, I can see all the…
0
votes
0 answers

Easyadmin An error has occurred resolving the options of the form. Invalid upload directory it does not exist or is not writable

I've made an application for my exams using symfony 6, Easyadmin4 and debian10 for my dedicated server. I create in EasyAdmin, an Header feature to change my header from my EasyAdmin menu. There is the code for my…
damian
  • 49
  • 5
0
votes
1 answer

Old symfony directory structure better?

I have seen that new symfony projects have a diffrent directory stucture. Mainly the ressources-folder is not used anymore. I personally found that old structuring very nice, since all ressources were where they were used. When I start using…
endo.anaconda
  • 2,449
  • 4
  • 29
  • 55
0
votes
1 answer

Firebase Authenticator JWT with Symfony API Platform

I have a Flutter client which uses firebase for user account creation. The user can publish tickets which arrives on a web administration panel built with Symfony 6 and API Platform. So I need 2 authenticators : 1 original Symfony Authenticator for…