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

How to generate routes ignoring extra passed parameters

Lets say that i have the following route annotations for a controller action: * @Route("/post/{post_id}/", name="post.view") * @Route("/post/", name="post.current_view") And I want to use twig to generate the url for this: {{ url(basePath~'view',…
Chase
  • 9,289
  • 5
  • 51
  • 77
0
votes
1 answer

Bug in generating urls from a subdomains in Symfony 2?

My project has a subdomain shop.example.com and routing.yml is using the host matching feature (requires Symfony >=2.2) as explained here: example_shop: resource: "@MyShopBundle/Controller/" type: annotation prefix: / host: …
gremo
  • 47,186
  • 75
  • 257
  • 421
0
votes
1 answer

Translated Symfony routes with multiple parameters

As the title suggests, I'm using Symfony in conjunction with the JMSTranslationBundle and JMSI18nBundle in order to serve translated routes. Here's my currently configured route: /{location}/{profession}/{specialty} So the…
kinghfb
  • 1,011
  • 5
  • 14
0
votes
2 answers

Symfony2 - Same route name for two different URL

In my Synfony2 wep application, there is two different role that the same user can have. He can whether be an employee or a boss. So, I want to have a switch button the change role so the user have a different view on data. For example, has a Boss…
Frank6
  • 1,193
  • 1
  • 11
  • 23
0
votes
1 answer

Match an exact path with Symfony 2 not just the prefix

I have the following routes hekdb_login_show: path: /Login/showForm defaults: { _controller: HEKdbBundle:Login:showForm } hekdb: path: / defaults: _controller: FrameworkBundle:Redirect:redirect route: hekdb_login_show …
user2690527
  • 1,729
  • 1
  • 22
  • 38
-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

Route not found/matched when using symfony 4 inside a subfolder

I have this apache server configured in mydomain.com/applications and inside that folder I have /project1/ - using silex /project2/ - using symfony 4 The server uses mod_rewrite and mydomain.com is represented by /var/www/html which is mapped as…
Ricardo Martins
  • 5,702
  • 3
  • 40
  • 59
-1
votes
2 answers

How to generate an URL for a controller in Symfony?

I know how to generate an URL for a route. However now I need to generate an URL for a controller or for a controller with a method. I checked the sourced of UrlGenerator but did not find any relevant information. No information in Symfony docs as…
FreeLightman
  • 2,224
  • 2
  • 27
  • 42
-1
votes
1 answer

Symfony Routing or Symfony Annotations?

I am starting a new symfony web app and i want this project to be as clean as possible. I can't make the decision between routing annotations or base symfony routing in my routes.yml file. Is there any pros and cons to either?
mattoakley
  • 11
  • 3
-1
votes
1 answer

Symfony Routing Requirements ignored

In a Symfony 3.4 Application I have the following route definition /** * @Route("/{_locale}", name="homepage") * requirements={ * "_locale":"de" * } */ public function indexAction( Request $request, $_locale ) { ... } When…
user3440145
  • 793
  • 10
  • 34
-1
votes
2 answers

symfony 2 - Language version - No route found for “GET /”

Symfony2 returns No route found for "GET /nl" when I try to run http://localhost/nl app/config/routing.yml #hwi_oauth_redirect: # resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml" # prefix: /connect # …
Jarek
  • 39
  • 8
-1
votes
1 answer

How to match all controllers and actions using routing.yml

I am working on a project where I have about 98 controllers. We have decided to migrate this project to Symfony. I have been able to create a custom Bundle called "mdBundle". It gets registered and I able to access the controller without any issue…
zeid10
  • 511
  • 8
  • 28
-1
votes
1 answer

Symfony throwing ResourceNotFoundException with overridden error templates

I have a small problem. I have already overridden the templates in app/Resources/TwigBundle/views/Exception/ and have error, error404 and error500.html.twig respectively. I have deleted the cache and upon going on a undefined page I get: Fatal…
George Irimiciuc
  • 4,573
  • 8
  • 44
  • 88
-1
votes
2 answers

User submit form, but don't save until he register or login

I have many forms that user fill on single page, but after user make post, controller will check if form is valid and if user is already logged in then save info. Need help with If user is not logged in, then redirect him to registration page where…
Basit
  • 16,316
  • 31
  • 93
  • 154
-1
votes
1 answer

What does the @param keyword do in symfony routes

In annotations for a route what does @param mean? I can not find any documentation on symfony website regarding this keyword and very confused as to what it's for and does. I'm asking because I'm trying to figure out how to access parameters in my…
Joseph Astrahan
  • 8,659
  • 12
  • 83
  • 154
1 2 3
13
14