gglnx/twig-component-handle-loader 问题修复 & 功能扩展

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

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

gglnx/twig-component-handle-loader

最新稳定版本:2.0.1

Composer 安装命令:

composer require gglnx/twig-component-handle-loader

包简介

Load Twig templates using Fractal-style component handles

README 文档

README

Packagist

Twig loader for loading templates by using a component handle based on the Fractal naming convention.

For example:

├── components
│   └── small-components
|       └── button
|           └── button.twig # Will be @button

You can now include the button template with the @[component-handle] syntax:

{% include '@button' %}

Requirements

  • Twig >=2.14
  • PHP >=7.4

Installation

The recommended way to install this loader is via Composer:

composer require gglnx/twig-component-handle-loader

Then you can use this loader directly with Twig:

require_once '/path/to/vendor/autoload.php';

$loader = new \Gglnx\TwigComponentHandleLoader\Loader\ComponentHandleLoader('../path-to-my-components');
$twig = new \Twig\Environment($loader);

You can also combine this loader with other loaders using ChainLoader.

Differences between this loader and the Fractal implementation

Prefixing and overriding the component handle require to read the corresponding component configuration. This could be out-of-scope for this loader and maybe better placed in a specific Twig Fractal loader.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固