romeoz/rock-template 问题修复 & 功能扩展

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

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

romeoz/rock-template

Composer 安装命令:

composer require romeoz/rock-template

包简介

Flexible template engine for PHP with MODx-like syntax

README 文档

README

Latest Stable Version Total Downloads Build Status HHVM Status Coverage Status License

Features

  • Supports native PHP engine and declarative MODx-like syntax (placeholders, chunk, snippet,...)
  • Supports multi-engines
  • Multi-scopes ($root and $parent)
  • The variety of filters (arithmetic/bitwise operations, conditions, string, date, and url)
  • Custom auto-escaping
  • Support adding/customization filters and snippets
  • There is a possibility of adding custom extensions
  • Widgets
  • Caching all entities template engine
  • Standalone module/component for Rock Framework

Installation

From the Command Line:

composer require romeoz/rock-template

In your composer.json:

{
    "require": {
        "romeoz/rock-template": "*"
    }
}

Quick Start

###PHP engine

use rock\template\Template;

$template = new Template;

echo $template->render('/path/to/layout.php', ['foo' => 'world!!!']);

Contents layout.php:

<?php
/** @var \rock\template\Template $this */
?>

Hello <b><?=$this->foo?></b>

###Rock engine

use rock\template\Template;

echo (new Template)->render('/path/to/layout', ['foo' => 'world!!!']);

Contents layout.html:

Hello <b>[[+foo]]</b>

Documentation

Demo

Requirements

  • PHP 5.4+
  • For caching layouts, chunks, placeholders and others variables required Rock Cache: composer require romeoz/rock-cache
  • For using a widgets required Rock Widgets: composer require romeoz/rock-widgets
  • For validation rules a model required Rock Validate: composer require romeoz/rock-validate
  • For sanitization rules a model required Rock Sanitize: composer require romeoz/rock-sanitize
  • For using filters to snippets required Rock Filters: composer require romeoz/rock-filters
  • For editing a image (cropping, watermarks and etc) required Rock Image: composer require romeoz/rock-image
  • For generating CSRF-token (security) required Rock CSRF: composer require romeoz/rock-csrf
  • For building a datetime (DateTimeSnippet and filter date) required Rock DateTime: composer require romeoz/rock-date

All unbolded dependencies is optional

License

The Rock Template engine is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-09-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固