Make sure that your server is configured with following PHP version and extensions:
- PHP 8.1+
- Spiral framework 3.7+
You can install the package via composer:
composer require zentlix/twig-extensionsTo enable the package in your Spiral Framework application, you will need to add
the Zentlix\TwigExtensions\Bootloader\ExtensionsBootloader class to the list of bootloaders in your application:
protected const LOAD = [
// ...
\Zentlix\TwigExtensions\Bootloader\ExtensionsBootloader::class,
];Note If you are using
spiral-packages/discoverer, you don't need to register bootloader by yourself.
Generate valid route URL using route name and set of parameters.
{{ path('user.edit', {'id': 1}) }}Translates the given message.
{{ 'message' | trans }}Checks that the value is of the correct type. Available checks: array, bool, object, class, float, int,
numeric, scalar, string.
{% if someVar is of_type('string') %}
// ...
{% else %}
// ...
{% endif %}composer testcomposer psalmcomposer csThe MIT License (MIT). Please see License File for more information.