PHP Класс 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
Автор: Bob den Otter, [email protected]
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$app
$safe boolean
$twigKey string

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

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

hasTemplate() публичный Метод

Check if the template exists.
public hasTemplate ( string $template ) : boolean
$template string The name of the template.
Результат boolean

postProcess() публичный Метод

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() публичный Метод

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
Результат Bolt\Response\TemplateResponse

Описание свойств

$app публичное свойство

public $app

$safe публичное свойство

public bool $safe
Результат boolean

$twigKey публичное свойство

public string $twigKey
Результат string