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
-2
votes
1 answer

Symfony 5.1 How to get controllers from other locations

What I want to achieve is to get the controllers and routes as annotations from an Api folder created ad-hoc but it seems to not work correctly on symfony 5.1 Here is my config services: App\Controller\: resource: '../../src/Controller' …
Claudio Ferraro
  • 4,551
  • 6
  • 43
  • 78
-2
votes
2 answers

The array from the JS file is not being sent to the symfony controller

There is a controller - MainController, it has a save Changes function, to which you need to pass an array from a Javascript file. Whatever I tried, everything does not fit, an empty request is output. JS: 'use strict'; $(function () { …
-2
votes
2 answers

Symfony asset image not found

I would like to display an image on my page, like this: The image is located in assets/image.png If I open the page, the result is this: But the image can not be found on that url. I…
Iter Ator
  • 8,226
  • 20
  • 73
  • 164
-2
votes
1 answer

Cannot autowite after update sumfony 5

I updated symfony from 4.4 to 5.0 and get errors like this Cannot autowire argument $category of "App\Controller\CategoryController::category()": it references class "App\Entity\Category" but no such service exists. My Controller code below. /** …
Kris
  • 121
  • 1
  • 10
-2
votes
3 answers

Symfony 5 Generating a URL from Console Command

I'm new to Symfony and am using 5.x. I have created a Console command using Symfony\Component\Console\Command\Command and am trying to use Symfony\Component\HttpClient\HttpClient to POST to a URL. I need to generate the URL to a route running on the…
Thejaka Maldeniya
  • 1,076
  • 1
  • 10
  • 20
-2
votes
2 answers

Why is my Symfony 5 local server showing the HTTP request as text instead of a rendered page?

I just wanted to try out Symfony 5 for my own education, so I followed the instructions here. symfony check:requirements shows that I have the requirements needed to run the application (I'm running Windows 10 with php 7.3.4 running via…
Ambulare
  • 897
  • 3
  • 10
  • 32
-2
votes
1 answer

Symfony 5 hanndle access for external tools (knpsnappy)

In a Symfony 5.x project I use knplabs/knp-snappy-bundle. Having private data-folders for different users results in generating PDF-documents that require images from folders which are not publicly accessable. When trying to generate a PDF-document…
-2
votes
1 answer

Is it possible to have different database connections per country but with same entities/model on Symfony 4 or 5?

Using Symfony 4 or 5, im trying to have a single app that talks to doctrine through the entity manager transparently using the default EM but changing connection based on locale. The idea is to some how check the locale on run time and decide for…
nachocifu
  • 100
  • 4
-2
votes
1 answer

Do not understand strange errors when upgrading from Symfony 4.4 to 5.0

I've been trying to upgrade our site from Symfony 4.4 to 5.0. I finally resolved all the composer dependencies and now I'm getting these errors: The file "../src/Controller/" does not exist (in:…
lfjeff
  • 1,840
  • 2
  • 17
  • 19
-2
votes
1 answer

Symfony access parameters from services.yaml in Entity

In Symfony 5.0 I need to access parameters defined in services.yaml inside an entity. When injecting the parameter_bag in services.yaml into my entity like App\Entity\MyEntity: class: App\Entity\MyEntity calls: - [setParameterBag,…
-2
votes
1 answer

How to allow path without login on ApiPlatform?

I have the following path: api_inventories_create_inventory_listing_collection POST ANY ANY /api/inventory/{type} Its defined in my entity as follows: @ApiResource( * …
TDawg
  • 833
  • 2
  • 8
  • 24
-2
votes
1 answer

Symfony add logic to logout route

In a Symfony 5.0 Application I want to add custom logic for cleanup reasons when the user loggs out. What I have currenty is what is described in the docs: https://symfony.com/doc/current/security.html#logging-out As the logout() function in the…
user3440145
  • 793
  • 10
  • 34
-2
votes
1 answer

Symfony 5 console command - problem with constructor with parameter

I have a problem with console's command in Symfony 5. I try to pass one parameter in constructor's command (TerytWMRODZRepository $terytwmrodzrepo), because I want to connect with database and exec queries. One way to do this is create repository to…
mahujedin
  • 1
  • 2
-2
votes
1 answer

ClassNotFoundError after installing custom Symfony Bundle

I created a simple custom Symfony bundle (in version 5.0). It's after I ran composer require located in vendor/ntrx/ntrx-user-bundle, but I'm not able to load it normally. The folder structure there is like…
mgluesenkamp
  • 529
  • 6
  • 19
-2
votes
2 answers

Symfony 5 Parse error: syntax error, unexpected '?' In C:\Users\public\index.php on line 15

I try to start a new project symfony 5 simple. When I start the server "symfony server: start", I have this answer: Parse error: syntax error, unexpected '?' In C:\Users\Philippe\Documents\my_project_name\public\index.php on line 15. I have windws…
Phil31971
  • 53
  • 1
  • 2
  • 3
1 2 3
71
72