seblucas/dot-php
最新稳定版本:1.1.0
Composer 安装命令:
composer require seblucas/dot-php
包简介
PHP rendering engine for doT.js (The fastest + concise javascript template engine for nodejs and browsers)
README 文档
README
PHP rendering engine for doT.js (The fastest + concise javascript template engine for nodejs and browsers).
How to use it
// Load the library require_once('resources/doT-php/doT.php'); // Load the template $page = file_get_contents('templates/page.html'); // instanciate the object $template = new doT(); // Compile your templace in a PHP function ($dot) $dot = $template->template($page); // the data is simple PHP array $data = array('title' => 'My custom title'); // Write the HTML echo $dot($data);
Warning
It's far from complete. I needed it just to provide a server side rendering engine for another project (COPS).
So the code provided works perfectly for the templates of COPS and was never tested elsewhere, doT's unit test were also never tested.
That being said, You can fork, enhance it and send me some pull request, I'll happily merge them.
统计信息
- 总下载量: 6.5k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2016-07-02