proklung/timber-twig-bundle

为自定义Wordpress + Symfony的Timber/Twig扩展包。

安装: 3

依赖: 0

建议者: 0

安全: 0

星级: 1

关注者: 1

分支: 0

开放问题: 0

类型:symfony-bundle

1.2.7 2021-08-12 19:21 UTC

This package is auto-updated.

Last update: 2024-09-13 01:58:15 UTC


README

内部

结果是在容器中出现服务 twig.instance(和 twig)带有配置的Twig实例。另外,容器加载后,Twig会自动链接到系统。

安装

composer.json

    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/proklung/timber.twig.bundle"
        }
    ]
composer require proklung/timber-twig-bundle

配置

连接额外的Twig功能

主容器中twig部分的示例

parameters:
  twig:
    functions:
      get_twig_header: Local\Services\TwigFunctionsExtended::renderHeader
      get_template_post: Local\Post::getTemplate