Questions tagged [symfony-routing]

Routing in Symfony Framework's MVC implementation. Symfony is a free, open source PHP web application framework, and it is released under the MIT license.

symfony-routing is a tag suitable for any questions regarding routing in Symfony's MVC implementation, url handling, or any other matter affecting or affected by routing in Symfony.

196 questions
1
vote
1 answer

How can I change the routes for Taxons in sylius-standard?

I am trying to change the routes for my Taxons but cannot find a way to do it. Current: {domain}/taxons/{taxon name} Desired: {domain}/categories/{taxon name} After searching Google/Stackoverflow I only could find a solution from 2018 that isn't…
Stan Vanhoorn
  • 526
  • 1
  • 4
  • 18
1
vote
1 answer

Overriding Symfony Controller Methods doesn't work properly

I am trying to create a new controller function in the overridden controller class but it doesn't work as intended. I have a common bundle where I use it for many clients. When sometimes when a client needs a specific function I creates an override…
Dula
  • 1,276
  • 5
  • 14
  • 23
1
vote
1 answer

Multiple subdirectories for controllers in annotations.yaml

I'm am trying to organize my controllers a bit more in a Symfony 5.3 application. They are in a couple of subdirectories and use annotations for their routing. Here are some…
ToBe
  • 2,667
  • 1
  • 18
  • 30
1
vote
1 answer

route defined with negative lookaround matches the route despite the negative assertion

We want to open a DELETE endpoint that allows calls to all positive integers, but not id 1 (aka element 1 cannot be deleted) Usually to open an endpoint that allows positive integers I configure the route like this delete_elements: path:…
Belen
  • 673
  • 2
  • 10
  • 25
1
vote
0 answers

Subresources routes in symfony 5 with API-platform

I am trying to declare a subresource in my symfony app. I followed the api-platform doc about it: https://api-platform.com/docs/core/subresources/ The subresource does appear in the routes, but not under its parent resource. The routes I currently…
Tom
  • 1,357
  • 2
  • 13
  • 32
1
vote
1 answer

TYPO3 9 routing - .html

Is there a possibility to configure routing in TYPO3 v9 to have .html applied to every URL? In ext:realurl and TYPO3 v8 (and previous versions) configuration defaultToHTMLsuffixOnPrev could have been used.
mcyg
  • 307
  • 2
  • 12
1
vote
1 answer

Optional trainling slash for optional slugs in POST route

I am using Symfony 4.2. When I set a route with an optional parameter, can I still use the route without a trailing slash? api_post: path: /api/drive/{slug?} controller: App\Controller\Api::load methods: POST My problem is, that the…
ESP32
  • 8,089
  • 2
  • 40
  • 61
1
vote
0 answers

TYPO3, routeEnhancers, rewrite simple url with parameters

In TYPO3 Version 9.5.11 I would like to have my own URL rewritten with GET parameters. The URL looks like…
Martin
  • 83
  • 3
  • 16
1
vote
1 answer

Is there a way to use both dynamic and static path on one controller?

I'm creating a Symfony CMS by myself. I want to map paths like /login and /{slug} at the same time, but I don't know if it is possible. I tried simply setting both of the paths in 2 different controllers, but that didn't seem to…
Dawid Cyron
  • 162
  • 1
  • 1
  • 11
1
vote
1 answer

How to return specific data using urls and routing in symfony 4 when making an API GET request?

I'm new to Symfony and trying to learn the basics. I recently saw this question and I wanted to learn how routing works. So I copied the Controller1.php from the question and changed it to UserController.php this:
user8678484
1
vote
1 answer

Deprecated: call_user_func_array() should not be called statically in Symfony Router Component

I work with symfony router component like this: index.php require '../application/core/Core.php'; $request = Request::createFromGlobals(); // Our framework is now handling itself the request $app = new Framework\Core(); $response =…
NewCod3r
  • 1,168
  • 1
  • 12
  • 28
1
vote
1 answer

Symfony annotation routing order

I'm currently stuck with routing in my Symfony4 (4.3) project. My problem is pretty simple, I want to use route annotations in my controllers but I want to defined the order of these one. For example, if I have two controllers with following routing…
Pierre
  • 776
  • 6
  • 27
1
vote
1 answer

How to get an associative array from URI path parameters?

I'm setting routes using Symfony/Routing component and mapping them to their respective controller and action. The problem is that some actions (methods) receive more than one parameter and I want to solve this issue passing an array from the…
gpaulini
  • 371
  • 4
  • 11
1
vote
1 answer

Symfony routing to distinguish ambiguous paths

I have a problem with Symfony routing. Even though I use different parameters to in the paths of two different routes Symfony identifies as a one pattern and directs to the path which is defined first in the routing file. For…
Teshan N.
  • 2,307
  • 3
  • 30
  • 59
1
vote
0 answers

how to handler a route matching in symfony or other router?

I'm using the Symfony router component. The router tells you if a defined route match with an incoming request and return you an array with the infomartion of that route(in my case I have defined a controller and method). I wanna know which is the…