wemakecustom/template-in-route-bundle
最新稳定版本:v1.0
Composer 安装命令:
composer require wemakecustom/template-in-route-bundle
包简介
Allow the Template to be configured directly in the Route
关键字:
README 文档
README
This bundle extends SensioFrameworkExtraBundle and is a port of the PR SensioFrameworkExtraBundle#266.
Installation
The bundle can be installed via composer:
php composer.phar require wemakecustom/template-in-route-bundle
You then simply need to enable it in your AppKernel:
new WMC\TemplateInRouteBundle\WMCTemplateInRouteBundle
Usage
This bundle allow the template to be specified directly in the Route via a
_template attribute, just like if the @Template annotation was used.
my_route:
path: /{product}-awesome
defaults: { _controller: Bundle:Product:show, _template: Bundle:Product:show-awesome.html.twig}
If the template is named after the controller and action names, you can even
skip the value for the _template parameter:
my_route:
path: /{product}-awesome
defaults: { _controller: Bundle:Product:showAwesome, _template: true }
This will use the template guesser, same as specifying @Template without a
template name.
When specified through the route, the _template parameter will be removed
from _route_params.
This is especially useful if Routes are generated programatically or if the same controller renders several routes requiring different templates.
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-07