List of Twig functions
Here you will find a list of features available in Twig views. They have been divided into modules so that you can understand them better.
flashes()
Returns a list of flash messages. The first level of the table is a pair of message type as key
(info
, success
, warning
, danger
) and list of messages as value.
Returns: array<string, array<int, string>>
locale()
Returns the active language of the site.
Returns: Tulia\Cms\Platform\Infrastructure\Framework\Routing\Website\LocaleInterface
locales()
Returns a list of all languages available for the site.
Returns: array<int, Tulia\Cms\Platform\Infrastructure\Framework\Routing\Website\LocaleInterface>
page_locale()
Returns the active language of the active site as an ISO code (e.g. en_US
).
Returns: string
current_website()
Returns the active site object with all its information (including its languages).
Returns: Tulia\Cms\Platform\Infrastructure\Framework\Routing\Website\WebsiteInterface
website_list()
Returns a list of sites available for this system installation.
Returns: array<int, Tulia\Cms\Platform\Infrastructure\Framework\Routing\Website\WebsiteInterface>
customizer_get()
Returns the value stored in the Customizer for the active theme. If there is none, it will return the default value of the control. As a parameter, it accepts the name of the control, and (optionally) the default value.
Returns: mixed
<div>{{ customizer_get('lisa.control') }}</div>
customizer_live_control()
Returns the HTML attributes needed for the built-in function of Live Control of Customizer.
<div {{ customizer_live_control('lisa.control') }}>
{{ customizer_get('lisa.control') }}
</div>
Returns: string
template()
It takes a relative link and returns an absolute link to the view file from the active theme.
Returns: string
{% include template('_parts/header.tpl') %}
parent_template()
It takes a relative link and returns an absolute link to the parent theme view file from the active theme.
Returns: string
{% include parent_template('_parts/header.tpl') %}