Blocks
Block - it is subprogram, called by name.
An example of block is described below:
<TMPL_block BLOCK_NAME>
Block code.
</TMPL_block>
For the call of block is used the operator of <TMPL_call BLOCK_NAME>. Name of the caused block can be assigned as directly ("FooBar"), so by means of the variable.
Example:
Template:
<TMPL_block "HELLO">
Hello, World!
</TMPL_block>
<TMPL_block "BYE">
Bye, bye!
</TMPL_block>
<TMPL_call block>
<TMPL_loop blocks>
<TMPL_call __CONTENT__>
<TMPL_loop>
Parameters:
block => "HELLO",
blocks => ["HELLO", "BYE"]
Output:
Hello, World!
Hello, World!
Bye, bye!
Copyright © 2003 - 2010 CTPP Dev. Team | http://ctpp.havoc.ru