Jelix 1.7.18

cfunction.fetchtpl.php

Tags
subpackage

jtpl_plugin

copyright

2019 Laurent Jouanneau

see
http://jelix.org/
licence

GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html

Table of Contents

jtpl_cfunction_common_fetchtpl()  : string
fetch the content of a template without template variables of calling template, except private variables setted by some plugins.

Functions

jtpl_cfunction_common_fetchtpl()

fetch the content of a template without template variables of calling template, except private variables setted by some plugins.

jtpl_cfunction_common_fetchtpl(jTplCompiler $compiler[, array<string|int, mixed> $param = array() ]) : string

It allows to use a template as a recursive way, in a cleaner way than include, because it doesn't inherits of variables from the parent template

Meta content must not use template variable given to 'fetch', as they will not be available at the time of meta processing (except if they are a copy of template variable of the parent template)

{fetchtpl 'myModule~foo', array('varname'=>'value) }
Parameters
$compiler : jTplCompiler

the template compiler

$param : array<string|int, mixed> = array()

0=>string the template selector (string) 1=>array a list of template variable to inject into the template 2=>boolean : inherits (true) or not of private variables. default is true.

Return values
string

the php code corresponding to the function content

Search results