crodas/simple-view-engine 问题修复 & 功能扩展

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

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

crodas/simple-view-engine

Composer 安装命令:

composer require crodas/simple-view-engine

包简介

Simple View engine designed to generate code. Based on Laravel's 4 Blade.

README 文档

README

This project is a simple template compiler which aims to be compatible with Laravel's Blade view engine.

It is different though as it generates code which doesn't depent at all in this project to run, therefore it can compile templates offline once.

How to use it

The simplest way of using the compiler is by downloading the phar cli application.

wget https://github.com/crodas/SimpleView/raw/master/view-compiler.phar -O view-compiler
chmod +x view-compiler

Now you have the view-compiler script ready to run. It is very simple to use now:

./view-compiler compile tests/views/

That would generate a single file tests/views/Templates.php with all our templates compiled.

require "tests/views/Templatas.php";

// By defualt its content will be print
Templates::get("if.tpl.php")->render(["name" => "cesar", "age" => 25]);

// but it can buffered as well
$buffer = Templates::get("if.tpl.php")->render(["name" => "cesar", "age" => 25], true);
echo $buffer;

You can optionally give a namespace to the generate template file to avoid class name conflicts

./view-compiler compile tests/views/ -N demo

Syntax

It is compatible with Laravel's Blade view engine.

TODO

  1. Better error support
  2. Mode documentation

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-4-Clause
  • 更新时间: 2013-06-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固