Slide 36
Slide 36 text
Prefix in the route name
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
/**
* @Route("/blog",
name="blog_")
*/
class BlogController extends Controller
{
/**
* @Route("/", defaults={"page": "1"},
name="index")
* @Route("/page/{page}", name="index_paginated")
*/
public function indexAction($page, $_format) { ... }
/**
* @Route("/posts/{slug}",
name="post")
*/
public function showAction(Post $post) { ... }
}
• blog_index
• blog_index_paginated
• blog_post
http://symfony.com/blog/new-in-symfony-3-4-prefix-all-controller-route-names
3.4