Can Smarty register such a plug-in? Solution

Source: Internet
Author: User
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!

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.