sensorario/engine
最新稳定版本:v1.1.2
Composer 安装命令:
composer require sensorario/engine
包简介
yet another template engine
README 文档
README
This is a php engine. Made just to play. Learn. And becouse I simply love code. Please do not use this in production. It works. It is tested. But I am using it just to make some videos about open source or just for training.
[TOC]
Components
Installation
composer install sensorario/engine
Usage
require __DIR__ . '/vendor/autoload.php';
use Sensorario\Engine\EngineFactory;
$engine = (new EngineFactory)->getEngine();
$engine->render('template', $model);
Foreach
<ul>
{% foreach items as item %}
<li>{{item.id}}</li>
{% endforeach %}
</ul>
If statement
{% if foo.bar is 42 %}
{% endif %}
UI
This engine provides few UI items. A Grid, paginated. A Form.
View
{{View:{
"model": {
"title":"Ricerca"
}
}}}View
Form
{{Form:{
"form": {
"method": "POST",
"action": "cippalippa"
},
"fields": [
{ "name" : "name" },
{ "name" : "surname" },
{ "name" : "ciaone" },
{ "name" : "dob" }
]
}}}Form
Grid
{{Grid:{
"source":{
"repository":"Sensorario.Engine.ExampleRepo",
"resource":"",
"itemPerPage":"2"
},
"model":{
"title":"Griglia",
"headers": [
{ "type" : "text" , "field" : "name", "name" : "NOME" },
{ "type" : "text" , "field" : "surname", "name" : "COGNOME" }
],
"rowIdentifier":"id"
}
}}}Grid
统计信息
- 总下载量: 83
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-03-25