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

change redirection URL for not logged in user

When I'm not logged in and I navigate to a secured route (/admin/page0 in this example), it redirects me to "/login" URL. I want to change the redirection route to /admin/login #Secured Route: class DefaultController extends AbstractController { …
Med Karim Garali
  • 923
  • 1
  • 14
  • 37
-1
votes
1 answer

Api Platform not persisting embedded object

I'm still kind of new to api platform. I have two classes a User and a Company. A user has a company. When using the api platform post operation on users it is not setting existing companies or creating new companies. Instead it tries to persist the…
GatorGuy023
  • 297
  • 2
  • 3
  • 11
-1
votes
2 answers

Route with a lot of optional parameters in Symfony

I got a lot of products, and it can be filter with a lot of different parameters. So user input search parameter in a form, and then the list is filter by those parameters. I have try to create a route like this : /** * Display a list of product *…
vincent PHILIPPE
  • 975
  • 11
  • 26
-1
votes
1 answer

Use password encoder in form for new User

in UserController I have the following code $password = $form->get('password'); $encoded = $encoder->encodePassword($user, $password); It outputs an error $password must be a string. I tried changing value of $password to no effect.
-1
votes
1 answer

symfony: granted access to everyone only to GET method in access_control on API but still get 401 unauthorised if user do not have a token

I have a project with Symfony 5.1 using Lexik JWT v2.8.0, gesdinet jwt refresh token v0.9.1 and my own entity user. I can log in with JWT and get the token, save it in a HttpOnly cookie and use it with the protected APIs successfully. I have…
Alex
  • 1,230
  • 2
  • 24
  • 46
-1
votes
1 answer

Vichuploader breaks entity - Unexpected EOF

I am installing the package Vichuploader (https://github.com/dustin10/VichUploaderBundle). To make the file upload when no other inputs are changed from the entity I migrated my entity to add updated_at field. After this migration my entity does not…
Alphabetus
  • 309
  • 3
  • 12
-1
votes
1 answer

File uploading limited at 2MB

For my Symfony project I need to upload some photos with a form. All is working good for the sending when the file is under 2MB but when it's higher the server just tell me no. When I look at the Symfony Profiler to find the error I have this : But…
EnzoKilm
  • 29
  • 1
  • 7
-1
votes
1 answer

Bootstrap form does not work properly - Symfony

I have a problem with bootstrap (4.5.2) added to Symfony project(5.1.3). I've added all links from starting-template to base.html.twig file: Everything from bootstrap works properly(for example NavBar) excluding forms. It means, inputs does not have…
mmcib
  • 131
  • 1
  • 10
-1
votes
1 answer

Multilevel dynamic forms in Symfony

I need to create a form adding faculty to the database. First, the user selects a region from the list ( / ChoiceType), then the city of this region from the following list, the university, and finally enters the name of the faculty. The default…
Corathir
  • 11
  • 3
-1
votes
1 answer

How to provide Symfony routing parameter programatically?

In this Symfony route /** * @Route("/board/{board}/card/{card}", name="card_show", methods={"GET"}, options={}) */ public function show(Board $board, Card $card): Response { $card->getLane()->getBoard(); // Board instance // ... } How is…
Armin
  • 15,582
  • 10
  • 47
  • 64
-1
votes
1 answer

AutoWire argument in a new service

I have the following service :
vincent PHILIPPE
  • 975
  • 11
  • 26
-1
votes
1 answer

SYMFONY 5 Error : No route found for "GET /pins/create": Method Not Allowed (Allow: POST)

I create a local website to learn Symfony 5 but when I specify method="POST" in my template form I have error No route found for "GET /pins/create": Method Not Allowed (Allow: POST) In my controller, I want to get only the method POST but when…
Giyash
  • 11
  • 1
  • 2
-1
votes
1 answer

How to put User E-mail in the Logger file by loggingout in Symfony 5

I hope you can help me with this problem. I want to put the user email in the logger file when the user logs out every time. How can I do that? How can I pass the user information to the logout function? thanks in advance
Mohsen
  • 260
  • 3
  • 14
-1
votes
2 answers

Symfony 5 form creation failing

I added 2 entities to my project ( BookAuthor, BookSeries ) with php bin/console make:entity command, Then I generated a form class with make:form command. While testing I added a few Authors but when I tried opening the add/Series route I get this…
xrayian
  • 151
  • 2
  • 11
-1
votes
1 answer

Symfony 5 custom route with param result in 404 error

I'm new to Symfony 5 (I started learning it today) and I'm following a course on symfonycasts.com about it, I've done everything as the teacher showed but I still got a 404 error on my controller redirection, here's the code: