developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #1019: function.hook.php

File function.hook.php, 641 bytes (added by foxmask, 11 years ago)

Hook plugin

Line 
1<?php
2/**
3* @package     jelix
4* @subpackage  jtpl_plugin
5* @author    FoxMaSk
6* @copyright 2008 FoxMaSk
7* @link      http://havefnubb.org
8* @licence  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file
9*/
10
11/**
12 * hook plugin : 
13 *
14 * @param jTpl $tpl template engine
15 * @param string $event the event name to call
16 * @param array $params parameters to give to the listener
17 */
18
19function jtpl_function_html_hook($tpl, $event, $params=array())
20{
21
22    if ($event == '') return;
23   
24    $events = jEvent::notify($event,$params)->getResponse();
25   
26    foreach ($events as $event)
27        echo $event;
28
29}