Custom plug in : completely confused....
| From: | Luc Saint-Elie | Date: | Sat, 13 Apr 2002 20:31:35 +0000 |
| Subject: | Custom plug in : completely confused.... | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3682@lists.php.net to get a copy of this message | ||
hello,
As stated in a previous mail, I'm trying to understand how to write a plug in.
I'm trying withe very simple one that is supposed to assign to $smarty an array containing various client informations (browser type, operating system...) very basic stuff
I'm reading every bit of the doc but they are VERY confusing.
For exemple at :
http://www.phpinsider.com/php/code/Smarty/docs/plugins.functions.html
There is an example of a custom function without output
(what I want to do) but this function is called :
function.assign.php
So I'm wondering if
$smarty->assign($var, $value);
is a call to this custom function of the usual
$smarty->assign('me', 'Luc);
And so on....
My question :
1 The plug in function
=================
It has to return and array.. how does this function end?
The function is named
smarty_function_sniff_browser($params, &$smarty)
{
.......
}
if it was a classical function it would ends by
return $browser;
$browser is an array (
'type' =>
'version' =>
'platform' =>
'css' =>
'dom' =>
);
what is the ending for a Smarty plug-in
How to send the resulting array to Smarty ???????
2 the template(*.tpl) file
===================
How to I call the array ?
Thanks in advance
Luc