Procedures in templates is just some template code you can use wherever and as many times as you like. It has no understanding of scope.
Syntax
A simple procedure:
Code: Select all
<!-- PROCEDURE my_procedure -->
hello world<br />
<!-- ENDPROCEDURE -->
You can use any tags (except PROCEDURE) in a procedure:
Code: Select all
<!-- PROCEDURE my_procedure -->
hello world<br />
{S_USERNAME}<br />
<!-- IF 1 -->
{$FOO}<br />
<!-- ENDIF -->
{L_WHO_IS_ONLINE}<br />
<!-- INCLUDE forumlist_body.html --><br />
<!-- ENDPROCEDURE -->
Code: Select all
<!-- CALL my_procedure -->
Code: Select all
<!-- PROCEDURE my_procedure -->
hello world<br />
<!-- ENDPROCEDURE -->
<!-- DEFINE $MY_PROCEDURE = 'my_procedure' -->
<!-- CALL $MY_PROCEDURE -->
Code: Select all
<!-- PROCEDURE my_procedure -->
$VARIABLE is {$VARIABLE}
<!-- ENDPROCEDURE -->
<!-- DEFINE $VARIABLE = 'hello world' -->
<!-- CALL my_procedure -->
The code is attached to this post. Is it worth adding it to trunk?