guglielmopepe/tiler 问题修复 & 功能扩展

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

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

guglielmopepe/tiler

Composer 安装命令:

composer require guglielmopepe/tiler

包简介

Tiler provides a flexible, fast, and secure template engine.

README 文档

README

Tiler provides a flexible, fast and secure template engine.

Table of Contents

Benefits

  • Tiler is object oriented pattern
  • Tiler don't force yourself to learn something new
  • Tiler is simple like PHP, is powerful like PHP

Features

Tiler allows you to create child themes, parent themes and ancestor themes.

Tiler will check if the required template is present in the child theme otherwise it will look for it in the parent theme and continue along the chain of themes.

If Tiler it doesn't find the template in the parent theme it will throw an exception.

Installation

Use Composer

$ composer require guglielmopepe/tiler

Usage

Tiler use a Chain of Responsability design pattern.

This is a template in /child/theme directory:

// path file: /child/theme/template.php

<p><strong><?php echo $data['foo']; ?></strong></p>

This is a template in /parent/theme directory:

// path file: /parent/theme/template.php

<p><b><?php echo $data['foo']; ?></b></p>

This is a template in /ancestor/theme directory:

// path file: /ancestor/theme/template.php

<p><?php echo $data['foo']; ?></p>

Tiler will check if the required template is present in the child theme otherwise it will look for it in the parent theme and continue along the chain of themes.

$data = new \Classes\Data(['foo'=>'bar']);

$handler = new \Tiler\Classes\Handler('/directory/of/child/theme');
$handler->connect(new \Tiler\Classes\Handler('/directory/of/parent/theme'));
$handler->connect(new \Tiler\Classes\Handler('/directory/of/ancestor/theme'));

$command = new \Tiler\Classes\Command($data, $handler);
echo $command->render('/template.php');

Support

If you have a request, please create a GitHub issue.

If you discover a security vulnerability, please send an email to Guglielmo Pepe at info@guglielmopepe.com. All security vulnerabilities will be promptly addressed.

FAQ

Why use Data class with ArrayAccess interface?

The Data class allows you to pass data as if it were an array, but by extending the class you can also pass a Service Locator: you have an HMVC.

Why does Tiler have three separate classes?

Tiler has three separate classes for maximum flexibility:

  • You can use the Data class with a service Locator or as a Simple array;
  • You can use the Handler class in combination with a Strategy to load the template on a per-user basis;
  • You can use the Command class in conjunction with a Proxy to delay loading data into the template.

Contributing

If you want to say thank you and/or support the active development of tiler:

  1. Add a GitHub Star to the project.
  2. Share the project on social media.
  3. Write a review or tutorial on Medium, Dev.to or personal blog.

Contacts

If you need information please send an email to info@guglielmopepe.com.

Roadmap

See the list of open issues:

Change log

Please see Changelog file for more information on what has changed recently.

License

Distributed under the MIT License. Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-05-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固