Smarty登记函数,请指点

WBOY
Release: 2016-06-13 12:04:13
Original
916 people have browsed it

Smarty注册函数,请指点
请问smarty注册函数问题。

$smarty->register_function('dateline', 'handle_dateline'); //这是注册函数 ,第一个参数是什么意思?

function handle_dateline($params, &$smarty) {} //这是被注册函数 ,这2个参数是什么意思?

注册函数是不是会导致函数执行?是不是类似于调用函数?
------解决方案--------------------
注册的目的是让 smarty 找到他,不然就会出错!
------解决方案--------------------
说白了,它就是注册一个函数,让你在tpl调用。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template