Tempo – 3.Template contents

Template Variable

Template variable is enclosed with the begin tag {?= and end tag ?}. Template variable to be replace is written like this. {?=$TEMPO_VAR?}.

< Template file : tempo.sample.htm >

< PHP coding >

< Result >

BLOCK element

BLOCK allows you to set dynamic content within a static template. The notation of the block element of TEMPO and the Zope ZPT is similar. Well, with tempo you now can write :

< Template contents >

TEMPO attribute statements

These are the TEMPO attribute statements:

  • tempo:id – block handle. it is a unique identifier.
  • tempo:omit – remove tag, contents or block.
  • tempo:ctype – set contents type(text, html, php or not).

Tag attribute statement has a name and its value.

tempo:id statement

The block element on which a statement is defined is a unique identifier in the current HTML document. For example,

  • tempo:id=”eLoop”

tempo:omit statement

remove tag, contents or block.

< Template contents : tempo.sample.htm >

< PHP coding >

< Result(code) >

tempo:ctype statement

< Template contents : tempo.sample.htm >

< PHP coding >

ctype result
default
apple
text <span style=”color:red;”><?=$VAR?></span>
html <?=$VAR?>
php <span style=”color:red;”>apple</span>

tempo:include statement

You can specify which file to include in template file. (Like header.html and footer.html).

< Template file : tempo.sub.htm >

<Template file : tempo.main.htm >

< PHP coding >

< Result >

Auto adjust path

Tempo will automatically adjust HTML resource(image, link etc) path.

답글 남기기