Tomahawk uses Symfony's PhpEngine and Twig for templates. A Delegating engine is used so you can use either or both the template engines mentioned.
The easiest way to use the Template component is to make sure your Controllers extend
Tomahawk\Routing\Controller. You then have access to it through
Otherwise just add the following parameter to the construct method of your
Symfony\Component\Templating\EngineInterface and it will get injected in through the Service Container.
Template files must be in the
Resources/views folder with you Bundle.
Rendering A Template
A template name has the format
The engine can be omitted and defaults to
Rendering Using Full Template Name
Below is an example of rendering a template using the full name:
Rendering Using Partial Template Name
You can omit the Section if the template is in the view root page:
Passing Parameters To The Template
You can pass parameters to the template file by passing an array as the second parameter to