Releases: divengine/div
Releases · divengine/div
Div PHP Template Engine 6.1.1
Div PHP Template Engine 6.1.0
- Integration with
divengine\functions
- Constant definition using short circuit
- Pass PHPStan level 3
- More unit tests
- Minor refactorings
Div PHP Template Engine 6.0.1
- Improvements to div::cop with Reflection and strict mode
- Unit tests
Div PHP Template Engine 6.0.0
Moving forward to PHP 8.x && PHPStan checks level 3
Div PHP Template Engine 5.1.6
minor fix
: Array and string offset access syntax with curly braces is deprecated
Div PHP Template Engine 5.1.5
Fix
release
version 5.1.5fix
div::varExists() method
Div PHP Template Engine 5.1.4
Get version of div
release
version 5.1.4- new method
div::getVersion()
Div PHP Template Engine 5.1.3
Minor release with fixes
release
version 5.1.3fix
resolution of templates path for win and *nix OSfix
the relative path of included templates inside loop
Div PHP Template Engine 5.1.2
Fixes for orphan conditional parts ant standalone templates
release
version 5.1.2fix
orphan conditional partsfix
standalone preprocessed templates
Now this example works!
cmp.tpl
This is a generic template for create visual components. Each component have a face or content, and more child components. Each child can located in the face of their parent. The template self call recursively.
{strip}
?$location {{{$location} $location?
?$face {$face} $face?
?$components
[$components] component =>
{= component.div.standalone: true =}
{%% cmp: component %%}
[/$components]
$components?
?$location {$location}}} $location?
{/strip}
Button.tpl
<button>{$icon}{$caption}</button>
Page.tpl
<h1>Buttons</h1>
(( top ))
<p>Click on the buttons: <p/>
(( bottom ))
<h1>Fruits</h1>
(( fruits ))
index.php
<?php
use divengine\div;
echo new div("cmp", [
"id" => "welcomePage",
"face" => "{% Page2 %}",
"components" => [
[
"face" => "{% Button %}",
"location" => "top",
"caption" => "Click me",
"icon" => '*'
],
[
"face" => "{% Button %}",
"location" => "bottom",
"caption" => "Click me again",
"icon" => '#'
],
[
"face" => "<ul>(( items ))</ul>",
"location" => "fruits",
"components" => array_map(function ($caption) {
return [
"face" => "<li>{$caption}</li>", // or "<li>{\$caption}</li>" :D
"location" => "items"
];
}, ["Banana", "Apple", "Orange"])
]
]
]
);
Div PHP Template Engine 5.1.1
Support namespaces of div's childs
This is an important improvement for version 5.1.0 that was found quickly. For classes that belong to a specific namespace, the resolution of the class path does not work well.