Инструменты пользователя

Инструменты сайта


limb3_2007_4:en:packages:macro

MACRO package ( {{macro}} template engine )

We have been using and developing our own forked version of WACT-а template engine for 5 years. But WACT was build on two core principles what are appeared to be problems in templates with complex visualization logic. These principles are:

  • XML-like syntax.
  • Data contexts (data sources or scopes) that are used to display data from.

An essential part of WACT documentation is dedicated to contexts. XML-like syntax does not allow you to use WACT tags as values of regular tags attributes and also makes internal WACT architecture very complex that is hard to support and extend.

Thus the idea of macro appeared.

macro is build on the following principles:

  • No more XML-like syntax. Tags are marked with two brackets on both sides, e.g. include.
  • There are two data scopes only: global and local.
  • No more data sources - all data is displayed from regular php variables.
  • Be as simple as possible
  • Support all WACT features like templates wrapping, including

Just like WACT, macro compiles initial templates into an executable php-scripts with very clean syntax (much cleaner than WACT or Smarty) and executes them very fast (we will publish benchmark results later).

Our forked version of WACT will be supported by our team for a while but macro is number one priority at the moment.

For those who worked with WACT templates before there should be no problems to switch on macro. If you are new to macro we recommend you to read all pages in this section marked «For macro beginners».

P.S. MACRO package depends on CORE and FS packages.

For {{macro}} template authors

For {{macro}} beginners

For {{macro}} developers

Обсуждение

Ваш комментарий. Вики-синтаксис разрешён:
   _  __   ___    _  __   __ __   _  __
  | |/_/  / _ \  / |/ /  / // /  | |/_/
 _>  <   / // / /    /  / _  /  _>  <  
/_/|_|  /____/ /_/|_/  /_//_/  /_/|_|
 
limb3_2007_4/en/packages/macro.txt · Последние изменения: 2010/11/10 10:02 (внешнее изменение)