function.hook.php
Tags
Table of Contents
- jtpl_function_html_hook() : mixed
- hook plugin
Functions
jtpl_function_html_hook()
hook plugin
jtpl_function_html_hook(jTpl $tpl, string $event[, array<string|int, mixed> $params = array() ]) : mixed
It allows to retrieve HTML content, coming from responses of an event, and inserting at the place of the hook tag.
Example:
{hook 'myevent'}
In a Jelix Event listener:
function onmyevent($event) {
$event->add('html content');
}
Result:
html content
Parameters
- $tpl : jTpl
-
template engine
- $event : string
-
the event name to call
- $params : array<string|int, mixed> = array()
-
parameters to give to the listener