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

Symfony : Issue with routing

I'm new to Symfony, I follow a tutorial, the part about security and user management but I'm stucked with a problem that seems to come from my routing. I just created a login form that is actually working, when I go on /app_dev.php/login, the form…
AKMMM
  • 294
  • 1
  • 2
  • 19
1
vote
0 answers

Symfony: PHP class not found when loading Appbundle in Appkernel.php

For some weird reason my App and ApiBundle Classes are not found during registerbundles()-function of Appkernel.php. The classes are there and seeem to be correct and I cannot understand what the problem is. Appkernel-entries: new…
1
vote
1 answer

How can I write a regexp that recursively matches RESTful path?

Regexp being not my strength, I would like some help on this one, if it is even possible: I need to create a regexp that recursively matches a RESTful path. The purpose is to create a Symfony route matching this regexp. Here is some examples of what…
Boulzy
  • 446
  • 4
  • 11
1
vote
1 answer

Symfony 3 redirect all routes except with specific prefix

I'am trying to build an application using symfony and angular 2 and I was wondering if it is possible to redirect all routes to one specific action exept uri's that start with the /api prefix. thanks in advance.
nusje2000
  • 493
  • 9
  • 25
1
vote
1 answer

Symfony 2 route with no custom controller code

I have my routes defined using annotations in my SF2 application, however there are a handful of pages which although they have a distinct route and Twig template they require no controller code whatsoever which leads to empty methods such as…
crmpicco
  • 16,605
  • 26
  • 134
  • 210
1
vote
1 answer

Host name routing in Zend Expressive

Zend Expressive has an adapters for Aura.Router, FastRoute and zend-mvc Router and the route can match the method and path easily: get('/foo', $middleware); With zend-mvc Router component it is possible to match the hostname:
Vasil Dakov
  • 2,040
  • 2
  • 19
  • 38
1
vote
1 answer

Regex for slug in symfont route

I'm having trouble creating a Regex to match URL slugs [a-z] ("words" separated by single dashes) like this: wordone-wordtwo-wordtree in route: csa_platform_category: path: /c/{slug} defaults: { _controller:…
emwww
  • 93
  • 11
1
vote
1 answer

Super simple framework 301 redirect from Symfony routes

I try to build super simple framework. I don't want to use constrollers... basicly everything works good and this is great start for simple websites but I want one more feature that I have problems with. I try to achieve as simple as possible…
Krystus
  • 285
  • 3
  • 4
  • 14
1
vote
0 answers

Wrong route matched with same sub name

here is my menu class. public function createShopAdminMenu() { $menu = $this->factory ->createItem('root') ->setChildrenAttribute('class', 'nav nav-pills') ; $menu->addChild('Administration', ['route' =>…
Patrick
  • 829
  • 2
  • 13
  • 34
1
vote
1 answer

Symfony 2.6.1 app only running in PROD enviroment

I'm developping a Symfony 2 application (version 2.6.1) but I can only run it on PROD mode. When trying to access to the following URL : http://localhost/lawAdmin/web/app_dev.php I'm having the next error message: RouteNotFoundException in…
MiGU
  • 382
  • 3
  • 17
1
vote
1 answer

Symfony : Route overrides other templates

The problem is in strange behavior of route @Route("/{cityId}"). When this route is upper, than other routes (for example @Route("/editcity_{id}")), it overrides template. Look at screenshots: route /{cityId} is first and /editcity_{id} is the…
1
vote
1 answer

Symfony2 and Nginx, route by hostname

I have one Symfony2 project named SymfonyProject. I had until now one nginx config file that points to that project with www.symfonyproject.com I developed some static twig pages in the SymfonyProject which I would like to access with another url:…
Milos Cuculovic
  • 19,631
  • 51
  • 159
  • 265
1
vote
2 answers

Check routing in symfony2

I want to learn symfony and I start to create a small application. I have a question related to the routes. So, I have in my project the routes : /admin/homepage, /admin/news, admin/galery No if I write in url /admin, this route doesn't exist and I…
Harea Costicla
  • 797
  • 3
  • 9
  • 20
1
vote
0 answers

Symfony2 routing-structure "/" and "/news/page/{page}"

is there a way to combine my two routes "/" and "/news/page/{page}" so that I dont't need two routes with same defaults only to show a start-page? I'm using knpmenubundle and get trouble with marking menu item as active if one element has two…
nPoday
  • 95
  • 1
  • 10
1
vote
1 answer

Symfony CMF Dynamic router "was not able to match" logs

I have a Symfony 2.6 application using Symfony CMF routing bundle 1.3 where we use a combination of normal symfony routes and dynamic routes for custom stores (amongst other things, the below example focuses on one of our dynamic routers). The…
Nick
  • 1,219
  • 1
  • 13
  • 24