定制 wieni/wmtwig 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

wieni/wmtwig

最新稳定版本:1.0.2

Composer 安装命令:

composer require wieni/wmtwig

包简介

Improves the integration of Twig with component and entity-oriented projects

README 文档

README

Latest Stable Version Total Downloads License

Improves the integration of Twig with component and entity-oriented projects.

Why?

TODO

Installation

This package requires PHP 7.1 and Drupal 8 or higher. It can be installed using Composer:

 composer require wieni/wmtwig

How does it work?

Registering Twig templates as theme implementations

This module automatically registers your Twig templates as theme implementations. Modules and themes can indicate in their info.yml file which paths should be included:

name: Some theme
type: theme

wmtwig:
    templates: pages

If the module or theme has multiple paths, an array can be passed:

name: Some theme
type: theme

wmtwig:
    templates:
        - components
        - pages

The advantage against the default way of rendering Twig templates (see documentation) is that you don't have to manually define every template in a theme hook. Also, the folder structure of your templates is respected. This makes it possible to refer to templates in the same way as in Laravel projects, eg. node.product for the node/product.html.twig template.

It is recommended to not use the default templates folder for these templates, because they might clash with other Drupal theme implementations. Eg. when creating a template at path templates/node/page.html.twig, it will override the core page template.

Changelog

All notable changes to this project will be documented in the CHANGELOG file.

Security

If you discover any security-related issues, please email security@wieni.be instead of using the issue tracker.

License

Distributed under the MIT License. See the LICENSE file for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-10