2017 © Pedro Peláez
 

symfony-bundle template-in-route-bundle

Allow the Template to be configured directly in the Route

image

wemakecustom/template-in-route-bundle

Allow the Template to be configured directly in the Route

  • Thursday, July 2, 2015
  • by lemoinem
  • Repository
  • 5 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

WMCRouteInTemplateBundle

This bundle extends SensioFrameworkExtraBundle and is a port of the PR SensioFrameworkExtraBundle#266., (*1)

Installation

The bundle can be installed via composer:, (*2)

 php composer.phar require wemakecustom/template-in-route-bundle 

You then simply need to enable it in your AppKernel:, (*3)

 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., (*4)

 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:, (*5)

 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., (*6)

When specified through the route, the _template parameter will be removed from _route_params., (*7)

This is especially useful if Routes are generated programatically or if the same controller renders several routes requiring different templates., (*8)

The Versions

02/07 2015

dev-master

9999999-dev

Allow the Template to be configured directly in the Route

  Sources   Download

MIT

The Requires

 

template route

08/04 2015

v1.0

1.0.0.0

Allow the Template to be configured directly in the Route

  Sources   Download

MIT

The Requires

 

template route