Skip to content

02.36 Including pre processed templates

rafageist edited this page Nov 16, 2026 · 1 revision

2.36 Incluir plantillas preprocesadas

Los includes preprocesados analizan la plantilla incluida antes de insertarla.

Sintaxis

{%% var with path to the template part %%}

or

{%% path/to/template/part %%}

Ejemplo

index.php

<?php

echo new div('test.tpl', [
    'name' => 'Unnamed',
    'products' => [
        ['name' => 'Banana'],
        ['name' => 'Potato']
    ]
]);

index.tpl

Include:

[$products]
    {% part %}
[/$products]

Preprocessed:

[$products]
    {%% part %%}
[/$products]

part.tpl

{$name}

Salida

Banana

Potato

Unnamed

Unnamed

Div

Enlaces

Clone this wiki locally