Documentation

RenderInterface

Defines common interface to render any object.

Tags
used-by

\Grav\Framework\Flex\FlexObject

since
1.6

Table of Contents

Methods

render()  : ContentBlockInterface|HtmlBlock
Renders the object.

Methods

render()

Renders the object.

public render([string|null $layout = null ][, array<string|int, mixed> $context = [] ]) : ContentBlockInterface|HtmlBlock
APIYes
Parameters
$layout : string|null = null

Layout to be used.

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

Extra context given to the renderer.

Tags
example

$block = $object->render('custom', ['variable' => 'value']);

example

{% render object layout 'custom' with { variable: 'value' } %}

Return values
ContentBlockInterface|HtmlBlock

Returns HtmlBlock containing the rendered output.


        
On this page

Search results