<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://limb.nohau.ru/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://limb.nohau.ru/feed.php">
        <title>Фремворк Limb - limb3_2007_4:en:packages:macro</title>
        <description></description>
        <link>https://limb.nohau.ru/</link>
        <image rdf:resource="https://limb.nohau.ru/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-11-10T17:05:27+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:compiler&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:data_sources&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:dictionaries&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:errors_and_debug&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:expressions&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:filters_intro&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:form_tags&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:how_to_create_new_filter&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:how_to_create_new_tag&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:important_details&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:intro&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:list_tags&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:pagination&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:php_code_in_templates&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:pros_and_cons&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:tags_info&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:tags_intro&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:template_composition&amp;rev=1289372570&amp;do=diff"/>
                <rdf:li rdf:resource="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:template_file_name_resolving&amp;rev=1289372570&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://limb.nohau.ru/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>Фремворк Limb</title>
        <link>https://limb.nohau.ru/</link>
        <url>https://limb.nohau.ru/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:compiler&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>{{macro}} compiler</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:compiler&amp;rev=1289372570&amp;do=diff</link>
        <description>{{macro}} compiler

This page is essential for developers who want to create their own  tags or filters. After reading this page you will have a better understanding of the MACRO templates compilation process. 

It is considered that you have already read the</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:data_sources&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>How {{macro}} template gets data for displaying?</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:data_sources&amp;rev=1289372570&amp;do=diff</link>
        <description>How {{macro}} template gets data for displaying?

 considers that it works with literal variables or regular arrays. If you pass an object to  template, make sure that your object is supports ArrayAccess or Iterator interfaces depending on situation.

There are two common ways to get data inside template:</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:dictionaries&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Where {{macro}} searches for tags and filters?({{macro}} dictionaries)</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:dictionaries&amp;rev=1289372570&amp;do=diff</link>
        <description>Where {{macro}} searches for tags and filters?({{macro}} dictionaries)

Dictionaries

 supports only tags and filters that are registered in special dictionaries:

	*  tags dictionary,
	*  filters dictionary

 searches tags in:

	*  limb/macro/src/tags - by default</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:errors_and_debug&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>{{macro}} error messages and templates debugging</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:errors_and_debug&amp;rev=1289372570&amp;do=diff</link>
        <description>{{macro}} error messages and templates debugging

Template compilation errors

 compiler can detect the most of errors in templates.

Here is the list of errors that are considered to be fatal for a  template:

	*  Unbalanced template, that has an opening tag in one template and does not have a corresponding closing tag in the same template file(in case if this tag requires a closing tag).</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:expressions&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Expressions. How to render variable values in templates</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:expressions&amp;rev=1289372570&amp;do=diff</link>
        <description>Expressions. How to render variable values in templates

Expressions syntax

Expressions - are special entities of  template that have two main functions:

	*  to render variables (in such cases expressions are called output expressions):
		*  {$percentage} - renders a variable from local data scope. The same as &lt;?php echo $percentage; ?&gt;</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:filters_intro&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Filters. How to modify or format data on rendering.</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:filters_intro&amp;rev=1289372570&amp;do=diff</link>
        <description>Filters. How to modify or format data on rendering.

Filters are used to modify or to apply some special formatting rule to variables in expressions. Filters are separated from other  part of expression by vertical line. Several filters are separated by vertical lines too:</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:form_tags&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Forms and form elements</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:form_tags&amp;rev=1289372570&amp;do=diff</link>
        <description>Forms and form elements

 has aids to auto populate form fields with previously sent data in case of validation errors. There are also tags for generating &lt;select&gt; tags with options and for rendering validation errors (of the server side validation).</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:how_to_create_new_filter&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>How to create your own {{macro}} filters</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:how_to_create_new_filter&amp;rev=1289372570&amp;do=diff</link>
        <description>How to create your own {{macro}} filters

 filters are stored in files with .filter.php suffix in file name. Filters files can be found in limb/macro/src/filters/ folder and also in src/macro folders of Limb3 packages and Limb-based applications.

Filters core classes</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:how_to_create_new_tag&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>How to create your own {{macro}} tags</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:how_to_create_new_tag&amp;rev=1289372570&amp;do=diff</link>
        <description>How to create your own {{macro}} tags

It is considered that you have already read this two pages:

	*  &quot;{{macro}} compilation and rendering. How to run {{macro}} template.&quot;,
	*  {{macro}} compiler,

 tags are stored in files with .tag.php suffix in file name. Tags files can be found in limb/macro/src/tags/ folder and also in src/macro folders of Limb3 packages and Limb-based applications.</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:important_details&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>{{macro}} compilation and rendering. How to run {{macro}} template.</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:important_details&amp;rev=1289372570&amp;do=diff</link>
        <description>{{macro}} compilation and rendering. How to run {{macro}} template.

Compile time vs run time

 is a PHP compiling template engine, which basically means that  creates PHP code while parsing the template markup. Generated PHP code is cached on the disk, then it is included and executed. Since generated PHP code  is cached, this provides</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:intro&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Introduction to {{macro}}. {{macro}} templates syntax and entities.</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:intro&amp;rev=1289372570&amp;do=diff</link>
        <description>Introduction to {{macro}}. {{macro}} templates syntax and entities.

This page demonstrates a simple example of  template and covers briefly  syntax and template entities like tags, output expressions and filters.

{{macro}} template example


{{wrap with=&quot;page.phtml&quot; in=&quot;content_zone&quot;}}
&lt;img src={$#photo.largeFileUrl} /&gt;
&lt;dl&gt;
&lt;dt&gt;Author:&lt;/dt&gt;&lt;dd&gt;{$#photo.member.name}&lt;/dd&gt;
&lt;dt&gt;Category:&lt;/dt&gt;&lt;dd&gt;{$#photo.category.title}&lt;/dd&gt;
&lt;dt&gt;Title:&lt;/dt&gt;&lt;dd&gt;{$#photo.title}&lt;/dd&gt;
&lt;dt&gt;Tags:&lt;/dt&gt;
&lt;dd&gt;
{{list using…</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:list_tags&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Rendering lists or tables</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:list_tags&amp;rev=1289372570&amp;do=diff</link>
        <description>Rendering lists or tables

{{macro}} tags for rendering lists

Let's consider the following example:


 &lt;table border=&quot;1&quot;&gt;
   &lt;tr&gt;
    &lt;th&gt;№&lt;/th&gt;
    &lt;th&gt;Title&lt;/th&gt;
    &lt;th&gt;Volume, liters&lt;/th&gt;
    &lt;th&gt;Weight, kg&lt;/th&gt;
   &lt;/tr&gt;
 {{list using=&quot;$#tanks&quot; as=&quot;$tank&quot; counter=&quot;$number&quot;}}
   {{list:item}}
   &lt;tr&gt;
    &lt;td&gt;{$number}&lt;/td&gt;
    &lt;td&gt;{$tank.name}&lt;/td&gt;
    &lt;td&gt;{$tank.volume}&lt;/td&gt;
    &lt;td&gt;{$tank.weight}&lt;/td&gt;
   &lt;/tr&gt;
   {{/list:item}}
  {{list:empty}}
  &lt;tr&gt;&lt;td colspan='4'&gt;List is empty!&lt;/td&gt;&lt;/tr…</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:pagination&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Rendering lists with pagers. Pagination</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:pagination&amp;rev=1289372570&amp;do=diff</link>
        <description>Rendering lists with pagers. Pagination

In most cases lists are too long to be displayed on a single page. In such cases lists are splited into many small pages. We call this pagination.

Pager - is a bunch of links that allow visitors to jump to other pages of displayed list. Pager can come in different forms: it can be just two links</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:php_code_in_templates&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>php-code in {{macro}} templates</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:php_code_in_templates&amp;rev=1289372570&amp;do=diff</link>
        <description>php-code in {{macro}} templates

As you may know  compiles initial templates into regular php-class. That's why you can insert any php-blocks in  templates, e.g.:


 &lt;select name='my_selector'&gt;
  &lt;?php 
   foreach($this-&gt;items as $item) 
   {
     echo '&lt;option value=&quot;'. $item['value'] . '&quot; ';
      if(some_condition())
       echo 'selected';
     echo '&gt;'. $item['title'] .'&lt;/option&gt;';
   }
  ?&gt;
 &lt;/select&gt;</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:pros_and_cons&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Pros and cons of MACRO template engine</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:pros_and_cons&amp;rev=1289372570&amp;do=diff</link>
        <description>Pros and cons of MACRO template engine

Pros

	*  MACRO has powerful tools for templates composition such as wrapping, including, reusing, multiple wrapping. We really don't know any other template engine that offers the same capabilities.

	*  MACRO is a</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:tags_info&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>{{macro}} tags</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:tags_info&amp;rev=1289372570&amp;do=diff</link>
        <description>{{macro}} tags

Tags - are control elements of  templates. 

Tags are commonly have a closing tag (like list or wrap), but there also tags that don't have a closing tag like slot.

Tags annotations

Tags can be found in *.tag.php files in limb/macro/src/tags and in /src/macro folders of your packages. In the head of each tag file there are</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:tags_intro&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Tags</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:tags_intro&amp;rev=1289372570&amp;do=diff</link>
        <description>Tags

Tags - are elements of  template that generates PHP code (in most cases).

Tags can have a short form like  and a full form with opening and closing tags ..tag content..

MACRO requires that tags must have both opening and closing tags in the same template file. You can't, for example, open a tag in one template and close it in another.</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:template_composition&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Templates composition (including, wrapping and reusing)</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:template_composition&amp;rev=1289372570&amp;do=diff</link>
        <description>Templates composition (including, wrapping and reusing)

 has a rich set of tools for template composition:

	*  Including - inserting the content of other template into the current template
	*  Wrapping - wrapping a part or the whole content of the current template into some particular point (so called</description>
    </item>
    <item rdf:about="https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:template_file_name_resolving&amp;rev=1289372570&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-11-10T07:02:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>How {{macro}} searches template files by aliases?</title>
        <link>https://limb.nohau.ru/doku.php?id=limb3_2007_4:en:packages:macro:template_file_name_resolving&amp;rev=1289372570&amp;do=diff</link>
        <description>How {{macro}} searches template files by aliases?

 can work both with absolute template file paths and aliases(relative ones):

	*  /var/dev/project/template/news.phtml - absolute path
	*  news.phtml - an alias

 resolves aliases using template locator</description>
    </item>
</rdf:RDF>
