spiral/twig-bridge 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

spiral/twig-bridge

最新稳定版本:v2.0.1

Composer 安装命令:

composer require spiral/twig-bridge

包简介

Spiral Framework: Twig Adapter

README 文档

README

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

Documentation | Framework Bundle

Installation

The extension requires spiral/views package.

composer require spiral/twig-bridge

To enable extension modify your application by adding Spiral\Twig\Bootloader\TwigBootloader:

class App extends Kernel
{
    /*
     * List of components and extensions to be automatically registered
     * within system container on application start.
     */
    protected const LOAD = [
        // ...
        
        Spiral\Twig\Bootloader\TwigBootloader::class,
    ];
}

Configuration

You can enable any custom twig extension by requesting Spiral\Twig\TwigEngine in your bootloaders:

class TwigExtensionBootloader extends Bootloader 
{
    public function boot(TwigEngine $engine)
    {
        $engine->addExtension(new Extension());
    }
}

Lazy Configuration

To configure TwigEngine on demand use functionality provided by TwigBootloader:

class TwigExtensionBootloader extends Bootloader 
{
    public function boot(TwigBootloader $twig)
    {
        $twig->addExtension('container.binding');
    }
}

Note Following methods are available setOption, addExtension, addProcessor.

License:

MIT License (MIT). Please see LICENSE for more information. Maintained by Spiral Scout.

统计信息

  • 总下载量: 61.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 5
  • 推荐数: 1

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-05-02