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

How to debug (and fix) Symfony2|3 routes?

I have this routes defined at app/config/routing.yml in a Symfony 2.8 app: platform_chat: resource: "@PlatformChatBundle/Controller/" type: annotation prefix: /chat platform_admin: resource: "@PlatformAdminBundle/Controller/" …
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
0
votes
2 answers

Redirecting before Symfony2 routing

I'm developing a high-traffic/high-seo-focused web. Now we're doing redirects just at the beggining of the actions but it's a bit slow. Is there a way to hook before the routing and do the redirect there (we've do a Redis query in order to know if…
Astaroth
  • 763
  • 6
  • 25
0
votes
1 answer

Overwrite variable path with defined path

I'm using fos userbundle to create pages for the route /profile. Now I want to be able to see other users profiles too so I created my own controller generating /profile/{username}. The problem I'm having now is that I can't use the fos userbundle…
Moopsish
  • 164
  • 2
  • 11
0
votes
2 answers

Custom authorization check before executing controller

I've added a new option roles in routing settings for checking permissions for menu items during a menu rendering. It would be great if I could use the option for authorization check before executing corresponding controllers. Example:…
Vasily
  • 1,858
  • 1
  • 21
  • 34
0
votes
1 answer

Custom Symfony CMF dynamic router implementation

I want to use dynamic routing combined with default controller routing. I have a table "Page" which has a column "url" to which the incoming request url should be checked against. If the url is not found in this table, the default controller routes…
BigJ
  • 1,990
  • 2
  • 29
  • 47
0
votes
3 answers

Redirect from existent route to a new one

I'm trying to redirect if a user is not logged in (works with FOSUser and SonataAdmin) and calls either http://domain.com/app_dev.php (dev) or http://domain.com (prod) then I want in both cases redirect to /login so I wrote this config at…
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
0
votes
0 answers

Symfony CMF ActionBlock routing

I am using Symfony CMF 1.2 and I need to control how URLs redirect within a rendered twig through an ActionBlock. I have a ProductBundle that handles 3rd party calls, does some processing and uses a twig file to render the output. Now in Symfony CMF…
Rishi
  • 667
  • 1
  • 6
  • 13
0
votes
1 answer

Symfony2 wildcard routing

I'm trying to create a special route that handles confirmation of a certain action. For instance, if I'm trying to access a route /admin/user/1/delete, I want to go to a different route first to show a special html page that confirms they want to…
David W
  • 1,833
  • 5
  • 21
  • 25
0
votes
2 answers

Route names starting with underscore in Symfony2

I'm working on a Symfony2 project and in the file routing.yml I have the following lines: _front: resource: routing_front.yml _admin: resource: routing_admin.yml prefix: /admin So this actually allows defining the routes for the…
Didier Ghys
  • 30,396
  • 9
  • 75
  • 81
0
votes
1 answer

Doubts around Symfony2 Routing component usage

I'm setting up FOSRestBundle and have some doubts, don't know if related to Symfony2 Routing component or can be done in any other way. Here, 1) How do I check if X-PDONE-SESSION-ID is set on request headers before execute the method? Can this be…
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
0
votes
1 answer

symfony2 routing defaults

I have defined a controller with annotation @Route("/add,{elId},{elType},{parentId}",name="MeaTask_Add", defaults={"elId"=null,"elType"=null, "parentId"=null}) public function addAction($elId=null, $elType=null, $parentId=null, Request $request){ I…
Developer
  • 2,731
  • 2
  • 41
  • 71
0
votes
1 answer

FOSJsRoutingBundle: do NOT expose secured and denied routes

I am using FOSJsRoutingBundle along with FOSRestBundle and what I want to do is define whole controllers for exposing routes like here: # Bundle's routing.yml imported as resource in app/config/routing.yml my_api: resource: …
Wirone
  • 3,304
  • 1
  • 29
  • 48
0
votes
0 answers

Generate well formed routes from MenuBuilder class in Symfony2

I've this route defined in a controller: /** * @Secure(roles="IS_AUTHENTICATED_FULLY") * @Route( * "/proccess/{slug}", * requirements={"slug": "^([a-zA-Z0-9]*-[a-zA-Z0-9]*)+$"}, * name="registerRPNI" * ) */ public…
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
0
votes
1 answer

Problems with page resources using FOSUserBundle

I would like to have the whole page access enabled only if user logged in (except the FOS user login page) This is how I set the access control: access_control: - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/resetting,…
J.T.
  • 135
  • 11
0
votes
2 answers

Use HTTP DELETE in symfony production environnement

i have a rest api, based on symfony 2.3. It works nice on debug mode but if i switch to prod env, i always get a 501 response error with this message "This method may not be used." on DELETE Http request (get works fine). I check the configuration,…
MarcD
  • 314
  • 1
  • 8