Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

Template engine.

There is two template engines in Amiro.CMS:

  • AMI_Template - lite template parser class that supports just language and variable replacement and can read templates from disk only but works faster than full version;
  • AMI_TemplateSystem - full version of template engine that supports all Amiro.CMS template syntax and can read templates from database as well.
AMI_Template is enough to use in plugin when:

  1. Plugin content is not saved to cache and high perfomance required.
  2. The template contains variables only (##name##, ##link## etc) and doesn't contain any special constructions like ##if(…)##, ##include_template…##, ##setvar…## and others.
  3. Template doesn't contain %%include_language%% statements. All localization files are included in PHP code of plugin.
  4. Code reads templates content from disk but not from database.

In other cases you can use AMI_TemplateSystem that allows you to to use complete Amiro.CMS template syntax.

Click here to view Template diagram.

• Interfaces:

AMI_iTemplate - Template parser class interface.

• Classes:

AMI_Template - Template parser lite class that works with disk templates only.
AMI_TemplateSystem - System template parser class.