PHP Class Bolt\Render

- Calls twig's render - Stores a page in cache, if needed - Store template (partials) in cache, if needed - Fetches pages or template (partials) from cache
Author: Bob den Otter, [email protected]
Exibir arquivo Open project: bolt/bolt Class Usage Examples

Public Properties

Property Type Description
$app
$safe boolean
$twigKey string

Public Methods

Method Description
__construct ( Silex\Application $app, boolean $safe = false ) Set up the object.
hasTemplate ( string $template ) : boolean Check if the template exists.
postProcess ( Request $request, Response $response ) Post-process the rendered HTML: insert the snippets, and stuff.
render ( string $templateFile, array $context = [], array $globals = [] ) : TemplateResponse Render a template, possibly store it in cache. Or, if applicable, return the cached result.

Method Details

__construct() public method

Set up the object.
public __construct ( Silex\Application $app, boolean $safe = false )
$app Silex\Application
$safe boolean

hasTemplate() public method

Check if the template exists.
public hasTemplate ( string $template ) : boolean
$template string The name of the template.
return boolean

postProcess() public method

Post-process the rendered HTML: insert the snippets, and stuff.
public postProcess ( Request $request, Response $response )
$request Symfony\Component\HttpFoundation\Request
$response Symfony\Component\HttpFoundation\Response

render() public method

Render a template, possibly store it in cache. Or, if applicable, return the cached result.
public render ( string $templateFile, array $context = [], array $globals = [] ) : TemplateResponse
$templateFile string Template file name
$context array Context variables
$globals array Global variables
return Bolt\Response\TemplateResponse

Property Details

$app public_oe property

public $app

$safe public_oe property

public bool $safe
return boolean

$twigKey public_oe property

public string $twigKey
return string