How plugins work

Source: Internet
Author: User

Plugins are always loaded on demand. only the specific modifiers, functions, resources, etc invoked in the templates scripts will be loaded. moreover, each plugin is loaded only once, even if you have several different instances of smarty running within the same request.

Plug-ins are always loaded as needed. Only specific modifiers, functions, resource plug-ins called in template scripts are loaded. In addition, each plug-in is loaded only once even if several different smarty entities are running in the same request.

 

Pre/postfilters and output filters are a bit of a special case. since they are not mentioned in the templates, they must be registered or loaded explicitly via API functions before the template is processed. the order in which multiple filters of the same type are executed depends on the order in which they are registered or loaded.

The loading methods of the PRE/fill filter plug-in and the output filter plug-in are somewhat different. Since they are not mentioned in the template, they must be explicitly loaded into the system through API functions before the template is processed. Multiple Filter plug-ins of the same type are executed in different loading order.

The plugins directory can be a string containing a path or an array containing multiple paths. to install a plugin, simply place it in one of the directories and Smarty will use it automatically.

The plug-in directory is a string containing a path or a string array containing multiple paths. When installing the plug-in, put the plug-in under one directory, and Smarty will automatically identify and use it.

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.