Questions tagged [symfony5]

Use this tag for questions addressing particular features of the PHP framework Symfony in version 5. 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 5 was released in November 2019 and includes several changes compared to its predecessor. However there are no new features compared to version 4.4.

1079 questions
-1
votes
1 answer

Is their a benefit to use cutom event instead of dependencies injection in Symfony?

I have a Mailer service which is responsible to create and send emails. I also have Registration service which confirm a user registration. What are the benefits to dispatch a custom event, subscribe to it and then send the email with the…
Benjamin
  • 341
  • 4
  • 15
-1
votes
1 answer

Symfony passing 'login' to default parameter of route

I added a default parameter to the route that is called after a user is authenticated. After running doctrine:fixtures:load to load new data I refreshed the page expecting it to take me to the login screen. However, it seems to be calling the route…
Brian Barrick
  • 89
  • 1
  • 9
-1
votes
1 answer

Symfony 5 dynamic routing resolve

I am migrating legacy project routing (Yii1) to Symfony 5 Right now my config/routing.yaml looks something like this: - {path: '/login', methods: ['GET'], controller: 'App\Controller\RestController::actionLogin'} - {path: '/logout', methods:…
Justinas
  • 41,402
  • 5
  • 66
  • 96
-1
votes
2 answers

How to access an entity within an entity in twig

In my controller, I return the entity so that my twig template can use it like so: return $this->render('review/index.html.twig',[ "list" => $applications ]); $applications is a query that returns the object I'm looking for: $applications =…
Majo0od
  • 2,278
  • 10
  • 33
  • 58
-1
votes
2 answers

Symfony5/Doctrine can't find my XML mapping file for my entity

I am currently trying to set up from scratch a Symfony 5 project using Doctrine with XML mapping. I created a simple AppBundle with some entities. After trying to generate my migration, I have this error : No mapping file found named 'User.orm.xml'…
Mouke
  • 854
  • 1
  • 7
  • 19
-1
votes
1 answer

How to save Foreign Key OneToMany Relationship in Symfony 5 with Doctrine

I am new to Symfony and I have a problem with saving a foreign key in the table. I try to explain it as well as possible. I am making a ToDo application. - Every user has one profile - Every profile has many items - Any User can add new items to the…
Mohsen
  • 260
  • 3
  • 14
-1
votes
1 answer

Missing vendor asset in prod env of symfony error-handler

After upgrading to symfony 5, I found a warning of a missing asset of symfony's error-handler: php.WARNING: Warning: include(/var/www/projekt/nakade/vendor/symfony/error-handler/ErrorRenderer/../Resources/assets/css/error.css): failed to open…
-1
votes
1 answer

Symfony get username from userid in twig template

I'm trying to make a table with all entities from the database. This works fine, but in the entity is only the user id saved. How I can fetch the username? {% for invite in invites %} {{ invite.code}} {{…
Tutorialwork
  • 63
  • 2
  • 9
-1
votes
1 answer

Browser image upload works, but not mobile browser

I am having a similar problem as described below. I have a site made in VueJS, backend is symfony PHP. php.ini allows 16M uploads a VueJS component for the upload: "vue-picture-input": "^2.1.6", And the relevant config: accept="image/jpeg,image/png"…
TDawg
  • 833
  • 2
  • 8
  • 24
-1
votes
1 answer

Updated symfony in composer.json, but I get an error when trying to install a new package with "require"

I upgrade Symfony to the 5.0 version. When I run the server, all is right. However, when I use composer (example composer remove tattali/calendar-bundle), I get these errors : C:\cmder\roadtrip>composer remove tattali/calendar-bundle …
Christophe Dubois
  • 283
  • 1
  • 3
  • 12
-1
votes
1 answer

How to set a cookie with PHP and Symfony?

My Symfony build project is running at localhost:8000. Now I need to create a cookie named token. I am confused about what should be path & domain? I have tried below code, it is not creating any cookie. $token = JWT::encode($tokenPayload,…
nas
  • 2,289
  • 5
  • 32
  • 67
-1
votes
1 answer

how to preselect an option of a dropdown list with symfony forms

An aticle has several variables. A title, a date, visibility and a category. If i render a form with symfony, i want to preselect a category in the dropdownlist. In the controller i have a function : /** * @return Response * @route…
Ace
  • 31
  • 9
-1
votes
1 answer

Page is still authenticated after gitlab is logout

I am using KnpUOAuth2ClientBundle for Symfony 5. When I enter the page, if user is not logged, then it redirects to gitlab page and on authentication it successfully redirects to my homepage where it stores cookie. But after I logout gitlab and…
user1687891
  • 794
  • 2
  • 14
  • 30
-1
votes
1 answer

Symfony: Export (CSV) File has limit?

I'm trying to send a generated CSV file using Symfony 5 and somehow seem to have reached a limit I can't overcome. For testing reasons I have broken it down to the basic of the basics; so I send static data, generate a txt-file and do no logic…
fun2life
  • 139
  • 1
  • 11
-1
votes
1 answer

Symfony 5 How to generate URL with slug?

I have an application with slug. All routes will start with the same url. URL looks like myapp.com/company_slug/locale/..... After I have submitted the login form, i have an error in my GuardAuthenticator to getLoginUrl(). Some mandatory parameters…
Kévin
  • 39
  • 10