Documentation

TemplateController
in package

TemplateController.

Tags
author

Fabien Potencier fabien@symfony.com

final

Table of Contents

$twig  : mixed
__construct()  : mixed
__invoke()  : Response
templateAction()  : Response
Renders a template.

Properties

Methods

__invoke()

public __invoke(string $template[, int|null $maxAge = null ][, int|null $sharedAge = null ][, bool|null $private = null ][, array<string|int, mixed> $context = [] ][, int $statusCode = 200 ]) : Response
Parameters
$template : string
$maxAge : int|null = null
$sharedAge : int|null = null
$private : bool|null = null
$context : array<string|int, mixed> = []
$statusCode : int = 200
Return values
Response

templateAction()

Renders a template.

public templateAction(string $template[, int|null $maxAge = null ][, int|null $sharedAge = null ][, bool|null $private = null ][, array<string|int, mixed> $context = [] ][, int $statusCode = 200 ]) : Response
Parameters
$template : string

The template name

$maxAge : int|null = null

Max age for client caching

$sharedAge : int|null = null

Max age for shared (proxy) caching

$private : bool|null = null

Whether or not caching should apply for client caches only

$context : array<string|int, mixed> = []

The context (arguments) of the template

$statusCode : int = 200

The HTTP status code to return with the response. Defaults to 200

Return values
Response

Search results