zentlix/twig-extensions
Composer 安装命令:
composer require zentlix/twig-extensions
包简介
Additional Twig extensions for Spiral Framework.
README 文档
README
Requirements
Make sure that your server is configured with following PHP version and extensions:
- PHP 8.1+
- Spiral framework 3.7+
Installation
You can install the package via composer:
composer require zentlix/twig-extensions
To 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.
Available functions
path
Generate valid route URL using route name and set of parameters.
{{ path('user.edit', {'id': 1}) }}
Available filters
trans
Translates the given message.
{{ 'message' | trans }}
Available tests
of_type
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 %}
Testing
composer test
composer psalm
composer cs
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 916
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-05-04