TEMPLATE_DIRECTORY
TEMPLATE_DIRECTORY
This is a plugin used to call the Twig template engine.
$application : \Gishiki\Core\Application|null
__construct(\Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response, \Gishiki\Core\Application|null $app = null)
TwigWrapper constructor: setup the plugin
Warning: you should never attempt to use another construction in your plugin, unless it calls parent::__construct()
\Psr\Http\Message\RequestInterface | $request | the HTTP request |
\Psr\Http\Message\ResponseInterface | $response | the HTTP response |
\Gishiki\Core\Application|null | $app | the current application instance |
setTwigLoader(\Twig_LoaderInterface|null $loader = null)
Load the Twig environment with the given loader.
\Twig_LoaderInterface|null | $loader | the Twig loader, null for the default one |
the given Twig loader is not valid
renderTwigTemplate(string $template, \Gishiki\Algorithms\Collections\CollectionInterface $data)
Render a Twig template and write the result to the response content.
Also set the mime type as text/html.
string | $template | the template file name |
\Gishiki\Algorithms\Collections\CollectionInterface | $data | the data to be processed to create the final result |
the Twig loader is not ready