limb3_2007_4:en:packages:macro:tags_info

{{macro}} tags

Tags - are control elements of macro 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 annotations that specify some meta informations as well as restrictions applied to the tag.

Here is the complete list of supported tags annotations:

  • tag - main tag name.
  • aliases - other tag names that are possible to use in templates instead of main tag name. In most cases aliases are used to keep BC. There can be several aliases separated with commas, e.g.: @aliases params,param.
  • req_attributes - the list of required attributes for the tag. macro compiler throws an exception in case of missing such attribute.
  • parent_tag_class - class name of the parent tag that must enclose the tag in template. If macro compiler can find such parent for the tag an exception will be thrown.
  • restrict_self_nesting - forbids the tag to have the same tag as enclosing parent in template.
  • forbid_end_tag - forbids the tag to have opening and closing tags. For example, input or input, but not input[…]input

Tags attributes

Tags can have one or more attributes.

The attributes of macro tags can have two types of values:

  • composite, e.g. {{input id=“title_{$index}”}} or {{input id=“title_{$#author.index}”}}

Note that input_id_title and {{input id=“{$title}”}} have the same meaning while input_id_author.title and {{input id=“{$author.title}”}} are not. That is because macro renders simple attribute values «as is» but processes complex attributes with expressions.

Обсуждение

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