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. In addition to the method of reloading the Smarty class, can I register a custom function like a plug-in? ------ Solution -------- 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. 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!