Can Smarty register such a plug-in? Generally, registered plug-in functions are called in the template file. My goal is not to add such a function, but to call it in a PHP script, just like how to call a function like display. That is, it is equivalent to reloading the Smarty class and adding a function for the Smarty class. Besides the method of reloading the Smarty class, can I register a plug-in like registering the Smarty class?
Generally, registered plug-in functions are called in the template file. My goal is not to add such a function, but to call it in a PHP script, just like how to call a function like display. That is, it is equivalent to reloading the Smarty class and adding a function for the Smarty class. In addition to the method of reloading the Smarty class, can I register a custom function like a plug-in?
------ Solution --------------------
Add a _ call method to the Smarty class.
I think Smarty should not be so low-level. Should I have done it?
------ Solution --------------------
Register the plug-in without using a template! -- Call? Did not understand!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.