Содержание
{{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.
Tags attributes
Tags can have one or more attributes.
The attributes of macro tags can have two types of values:
- simple, e.g. input_id_title or input_id_title
- composite, e.g. input_id_title_index or input_id_title
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.

Обсуждение