![MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Скачать руководство пользователя страница 103](http://html1.mh-extra.com/html/macromedia/coldfusion-4-5-developing-web/coldfusion-4-5-developing-web_develop-manual_3286369103.webp)
Chapter 7: Reusing Code
77
Nesting Custom Tags
ColdFusion lets you turn a custom tag into a special kind of container that can enclose
additional custom tags, which allows you to nest tags. Base tags are also know as
ancestors or parent tags, while the tags that base tags call are known as sub tags,
descendants, or child tags.
You can create multiple levels of nesting by closing a sub tag. In this case, the sub tag
becomes the base tag for its own sub tags. Any tag with an end tag present can be an
ancestor to another tag.
Nested custom tags operate through three modes of processing, which are exposed to
the base tags through the variable ThisTag.ExecutionMode:
•
The start mode, in which the base tag is processed for the first time.
•
The inactive mode, in which sub tags and other code contained within the base
tag are processed.
No processing occurs in the base tag during this phase.
•
The end mode, in which the base tag is processed a second time.
Associating sub tags with the base tag
While the ability to create nested custom tags is a tremendous productivity gain,
keeping track of complex nested tag hierarchies can become a chore. A simple
mechanism, the CFASSOCIATE tag, lets the parent know what the children are up to.
By adding this tag to a sub tag, you enable communication of its attributes to the base
tag.
Terms to Describe the Relationship Between Nested Tags
Calling tag
Tag that is nested
within the calling tag
Notes
base tag
sub tag
A base tag is an ancestor that
has been explicitly associated
with a descendant with
CFASSOCIATE.
ancestor
descendant
An ancestor is any tag that
contains other tags between its
start and end tags.
parent
child
"Parent" and "child" are
synonyms for "ancestor" and
"descendant."
Содержание COLDFUSION 4.5-DEVELOPING WEB
Страница 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Страница 14: ...xiv Developing Web Applications with ColdFusion...
Страница 26: ...xxvi Developing Web Applications with ColdFusion...
Страница 34: ...8 Developing Web Applications with ColdFusion...
Страница 70: ...44 Developing Web Applications with ColdFusion...
Страница 84: ...58 Developing Web Applications with ColdFusion...
Страница 114: ...88 Developing Web Applications with ColdFusion...
Страница 148: ...122 Developing Web Applications with ColdFusion...
Страница 174: ...148 Developing Web Applications with ColdFusion...
Страница 208: ...182 Developing Web Applications with ColdFusion...
Страница 244: ...218 Developing Web Applications with ColdFusion...
Страница 274: ...248 Developing Web Applications with ColdFusion...
Страница 288: ...262 Developing Web Applications with ColdFusion...
Страница 300: ...274 Developing Web Applications with ColdFusion...
Страница 350: ...324 Developing Web Applications with ColdFusion...
Страница 362: ...336 Developing Web Applications with ColdFusion...