Documentation

FlexCommonInterface extends RenderInterface

Defines common interface shared with both Flex Objects and Collections.

Tags
used-by

\Grav\Framework\Flex\FlexObject

since
1.6

Table of Contents

Methods

getCacheChecksum()  : string
Get cache checksum for the object / collection.
getCacheKey()  : string
Get a cache key which is used for caching the object / collection.
getFlexDirectory()  : FlexDirectory
Get Flex Directory for the object / collection.
getFlexFeatures()  : array<string|int, mixed>
Get full list of features the object / collection implements.
getFlexType()  : string
Get Flex Type of the object / collection.
getTimestamp()  : int
Get last updated timestamp for the object / collection.
hasFlexFeature()  : bool
Test whether the feature is implemented in the object / collection.
render()  : ContentBlockInterface|HtmlBlock
Renders the object.

Methods

getCacheChecksum()

Get cache checksum for the object / collection.

public getCacheChecksum() : string

If checksum changes, cache gets invalided.

Return values
string

Returns cache checksum.

getCacheKey()

Get a cache key which is used for caching the object / collection.

public getCacheKey() : string
Return values
string

Returns cache key.

getFlexFeatures()

Get full list of features the object / collection implements.

public getFlexFeatures() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFlexType()

Get Flex Type of the object / collection.

public getFlexType() : string
APIYes
Return values
string

Returns Flex Type of the collection.

getTimestamp()

Get last updated timestamp for the object / collection.

public getTimestamp() : int
APIYes
Return values
int

Returns Unix timestamp.

hasFlexFeature()

Test whether the feature is implemented in the object / collection.

public hasFlexFeature(string $name) : bool
Parameters
$name : string
Return values
bool

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