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
2 answers

Routing one url to two controller actions based on authentication

I'm a bit new to Symfony, but I've got an easy to explain situation: I've got a public home page, and a private home page. I'd like to have both of these accessible with the URL "/" When a non-authenticated person visits the address www.example.com/…
Jaimz
  • 790
  • 8
  • 12
1
vote
1 answer

Where should I put Symfony third-party bundle's routing configuration?

I have SonataAdminBundle, SonataUserBundle and LiipImagineBundle installed in my Symfony 2 application. According to their installation instruction, I put their routing configuration in /app/config/routing.yml. _liip_imagine: resource:…
Sithu
  • 4,752
  • 9
  • 64
  • 110
1
vote
2 answers

Circular reference detected in routing_dev.yml

I'm getting crazy with this circular reference issue and I can't find what I'm doing wrong. This is the content of /app/config/routing.yml: pd_one: resource: "@PDOneBundle/Controller/" type: annotation prefix: / template: …
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
1
vote
1 answer

FileLoaderImportCircularReferenceException when adding subdomain routing to Symfony

I am trying to route a subdomain to a specific bundle in Symfony2. Here's what I've got: I added local domains to my hosts: 127.0.0.1 todolist.lc 127.0.0.1 manager.todolist.lc I created a virtual host that forwards all subdomains to my…
Scuba Kay
  • 2,004
  • 3
  • 26
  • 48
1
vote
2 answers

symfony2.3 routing doesn't work on prod env

I'm trying to create a /contact route on my website using symfony on windows environment. I added in the routing.yml file the routes like this: fstn_venice_homepage: resource: "@FstnVeniceBundle/Resources/config/routing.yml" prefix: …
Dev DOS
  • 1,018
  • 4
  • 18
  • 45
1
vote
1 answer

Get value from URL in Javascript|jQuery and Symfony2 project

I need to get some parameters from URL using Javascript/jQuery and I found this nice function: function getURLParameter(sParam) { var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&'); for (var i =…
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
1
vote
1 answer

Symfony2 can't find Route on custom Route Loader

I'm having the same problem symfony2 is describing here This comes in handy when you have a bundle but don't want to manually add the routes for the bundle to app/config/routing.yml. This may be especially important when you want to make the…
user3531149
  • 1,519
  • 3
  • 30
  • 48
1
vote
1 answer

How to force symfony2 to use HTTPS only for one page

I have to use HTTPS for only single page in symfony2 app. I've tried like security.yml - { path: ^/payment, roles: ROLE_USER, requires_channel: https } It works good but when i navigate to other pages from /payment page its stays same in HTTPS…
1
vote
1 answer

How can I point a subdomain to a specific bundle?

How can I point a subdomain to a specific bundle. I have this vhost: ServerName subdomain1.mysite.dev ServerAlias subdomain2.mysite.dev DocumentRoot /mysite/web AllowOverride All …
cbacelar
  • 545
  • 7
  • 20
1
vote
1 answer

Symfony2 not picking up multiple routing yml files / Import not working in yml file

So first off TL:DR - Symfony isn't picking up additional routing files in my bundle. Don't know why. Tried doing imports like in config.yml and it's not working either I have multiple controllers for maintainability of my code. I.e. All site related…
Drew Landgrave
  • 1,515
  • 3
  • 13
  • 23
0
votes
0 answers

Symfony 6: how to register custom URL matcher

For some reason I need to register custom URL matcher in Symfony 6 but I'm getting weird error that my service doesn't exist: Service "App\Routing\QueryStringUrlMatcher" not found: the container inside…
0
votes
2 answers

Check if URL is in use in Symfony

I need to check if entered value, e.g "specialist", is not in use as an URL in Symfony 6 application. Simple ANY-method paths are simple: /** @var RouterInterface $router */ $router->match('/specialist'); // returns array Non-matching methods are…
JohnSmith
  • 436
  • 5
  • 17
0
votes
0 answers

Symfony\Component\Routing\RouteCollection Problem

I am include an App.php (rounting) page but my front.php do not get the type RouteCollection object (Argument #1 ($routes) must be of type Symfony\Component\Routing\RouteCollection) I am doing the excercise on the…
0
votes
0 answers

Incorrect routing via /config/routes.php in symfony 6.1

When I am defining routes in config/routes.php then those routes are not working in symfony 6.1 use App\Controller\BlogController; use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; return function (RoutingConfigurator $routes)…
0
votes
0 answers

Symfony redirect from "/" to "/{locale}"

I am working on a Symfony(4.4) project. I am trying to make eventSubscriber that will redirect user with locale based on saved cookie. The idea is when I visit homepage for first time(or if I have not saved cookie) I have to redirect myself to…
Dan
  • 52
  • 7