sensorario / engine
There is no license information available for the latest version (v1.1.2) of this package.
yet another template engine
v1.1.2
2023-05-19 06:46 UTC
Requires (Dev)
- friendsofphp/php-cs-fixer: dev-master
- phpunit/phpunit: 10.1.x-dev
- dev-main / 1.2.x-dev
- v1.1.2
- v1.1.1
- v1.1.1-RC-3
- v1.1.1-RC-2
- v1.1.1-RC-1
- v1.1.0
- v1.1.0-RC-12
- v1.1.0-RC-11
- v1.1.0-RC-10
- v1.1.0-RC-9
- v1.1.0-RC-8
- v1.1.0-RC-7
- v1.1.0-RC-6
- v1.1.0-RC-5
- v1.1.0-RC-4
- v1.1.0-RC-3
- v1.1.0-RC-2
- v1.1.0-RC-1
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
This package is auto-updated.
Last update: 2024-10-06 06:02:17 UTC
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