Skip to content

Releases: divengine/div

Div PHP Template Engine 6.1.1

06 Aug 03:46
Compare
Choose a tag to compare
  • Hot fix package version

Div PHP Template Engine 6.1.0

06 Aug 03:21
Compare
Choose a tag to compare
  • 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

27 Jan 01:55
Compare
Choose a tag to compare
  • Improvements to div::cop with Reflection and strict mode
  • Unit tests

Div PHP Template Engine 6.0.0

24 Dec 21:18
Compare
Choose a tag to compare

Moving forward to PHP 8.x && PHPStan checks level 3

Div PHP Template Engine 5.1.6

12 Feb 01:16
Compare
Choose a tag to compare
  • minor fix: Array and string offset access syntax with curly braces is deprecated

Div PHP Template Engine 5.1.5

22 Sep 01:18
Compare
Choose a tag to compare

Fix

  • release version 5.1.5
  • fix div::varExists() method

Div PHP Template Engine 5.1.4

23 Aug 05:23
Compare
Choose a tag to compare

Get version of div

  • release version 5.1.4
  • new method div::getVersion()

Div PHP Template Engine 5.1.3

23 Aug 05:17
Compare
Choose a tag to compare

Minor release with fixes

  • release version 5.1.3
  • fix resolution of templates path for win and *nix OS
  • fix the relative path of included templates inside loop

Div PHP Template Engine 5.1.2

22 Aug 18:03
Compare
Choose a tag to compare

Fixes for orphan conditional parts ant standalone templates

  • release version 5.1.2
  • fix orphan conditional parts
  • fix 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

23 Jul 04:11
Compare
Choose a tag to compare

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.