简体   繁体   English

Symfony 2-控制器的一条路线

[英]Symfony 2 - one route for the controller

This is my first time using symfony. 这是我第一次使用symfony。 I have used laravel 4 before. 我以前用过laravel 4。 In laravel there was a way to configure one route pattern for the entire controller. 在laravel中,有一种方法可以为整个控制器配置一个路由模式。 Somthing like Route::controller('users', 'UserController'); Route::controller('users', 'UserController'); In there something similar in symfony? 在symfony中有类似的东西吗?

Write your route over the complete class. 在整个课程上写下您的路线。 The all function routes insight are from that route. 所有功能路线的见解均来自该路线。

/**
 * @Route("/something")
 */
class yourController extends Controller {
}

http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/routing.html http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/routing.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM