承接 zentlix/twig-extensions 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zentlix/twig-extensions

Composer 安装命令:

composer require zentlix/twig-extensions

包简介

Additional Twig extensions for Spiral Framework.

关键字:

README 文档

README

PHP Version Require Latest Stable Version phpunit psalm Codecov Total Downloads type-coverage psalm-level

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-04