enm/external-layout-bundle

此整合将enm/external-layout集成到您的symfony项目中

2.1.1 2020-01-02 12:58 UTC

README

SensioLabsInsight

此扩展包将enm/external-layout集成到您的symfony项目中。

安装

    composer require enm/external-layout-bundle e-moe/guzzle6-bundle

YAML配置

YAML配置("布局")与enm/external-layout中的数组结构相同。

enm_external_layout:
    useGuzzle: true # default: false; requires a service "GuzzleHttp\ClientInterface" (e.g. e-moe/guzzle6-bundle)
    layouts:
      test:
          source: 'http://example.com'
          destination: '%kernel.project_dir%/templates/test.html.twig'
          blocks:
              prepend:
                  headline: 'body'
              append:
                  stylesheets: 'head'
              replace:
                  title: '$title$'

命令

enm:external-layout:create

此命令获取配置并为每个配置的布局创建一个twig模板文件。

# Create all templates
bin/console enm:external-layout:create

# Create the template "test.html.twig"
bin/console enm:external-layout:create --layout=test