HTML_Template_Flexy
[ class tree: HTML_Template_Flexy ] [ index: HTML_Template_Flexy ] [ all elements ]

Class: HTML_Template_Flexy_Compiler_Regex_SimpleTags

Source Location: /HTML_Template_Flexy-0.7.1/Flexy/Compiler/Regex/SimpleTags.php

Class Overview


The Standard Tag filter


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 32]
The Standard Tag filter


[ Top ]


Class Variables

$engine =

[line 37]


Type:   mixed


[ Top ]

$error =  "@"

[line 50]


Type:   mixed


[ Top ]

$start =  '\{'

[line 41]


Type:   mixed


[ Top ]

$stop =  '\}'

[line 46]


Type:   mixed


[ Top ]



Method Detail

conditionals   [line 302]

string conditionals( string $input)

Conditional inclusion

This allows you to do conditional inclusion (eg. blocks!)

Maps conditions

{if:t.xxxx} => <?php if ($t->xxxx) { ?> {if:t.x_xxx()} => <?php if ($t->x_xxx()) { ?>

  • Return: the result of the filtering
  • Access: public

Parameters:

string   $input     the template

[ Top ]

include_template   [line 348]

string include_template( string $input)

sub template inclusion

This allows you to do include other files (either flat or generated templates.).

{include:t.abcdef} maps to <?php if($t->abcdef && file_exists($compileDir . "/". $t->abcdef . "en.php")) include($compileDir . "/". $t->abcdef . ".en.php"); ?>

include abcdef.en.php (Eg. hard coded compiled template {include:#abcdef#} => <?php if(file_exists($compileDir . "/abcdef.en.php")) include($compileDir . "/abcdef.en.php"); ?>

include raw {t_include:#abcdef.html#} => <?php if(file_exists($templateDir . "/abcdef.html")) include($compileDir . "/abcdef.html"); ?> Compile and include {q_include:#abcdef.html#} => <?php HTML_Template_Flexy::staticQuickTemplate('abcedef.html',$t); ?>

  • Return: the result of the filtering
  • Access: public

Parameters:

string   $input     the template

[ Top ]

looping   [line 271]

string looping( string $input)

Looping

This allows you to do loops on variables (eg. nested/ repeated blocks!)

Maps Methods {foreach:t.xyz,zzz} maps to <?php if ($i->xyz) foreach ($t->xyz as $zzz) { ?> {foreach:t.xyz,xxx,zzz} maps to <?php if ($i->xyz) foreach ($t->xyz as $xxx=>$zzz) { ?> {end:} maps to <?php }?> {else:} maps to <?php }else{?>

  • Return: the result of the filtering
  • Access: public

Parameters:

string   $input     the template

[ Top ]

methods   [line 197]

string methods( string $input)

Calling Methods

This allows you to call methods of your application

Maps Methods {t.xxxx_xxxx()} maps to <?=htmlspecialchars($t->xxxx_xxxx())?> {t.xxxx_xxxx():h} maps to <?=$t->xxxx_xxxx()?>

{t.xxxx_xxxx(sssss.dddd)} maps to <?=htmlspecialchars($t->xxxx_xxxx($ssss->dddd))?> {t.xxxx_xxxx(sssss.dddd):h} maps to <?=$t->xxxx_xxxx($ssss->dddd)?> {t.xxxx_xxxx(sssss.dddd):s} maps to <?php highlight_string($t->xxxx_xxxx($ssss->dddd))?>

{t.xxxx_xxxx(#XXXXX#)} maps to <?=htmlspecialchars($t->xxxx_xxxx('XXXXXX'))?> {t.xxxx_xxxx(#XXXXX#):h} maps to <?=$t->xxxx_xxxx('XXXXXX')?>

{t.xxxx_xxxx(sss.ddd,sss.ddd)} maps to <?=htmlspecialchars($t->xxxx_xxxx($sss->ddd,$sss->ddd))?> {t.xxxx_xxxx(#aaaa#,sss.ddd)} maps to <?=htmlspecialchars($t->xxxx_xxxx("aaaa",$sss->ddd))?> {t.xxxx_xxxx(sss.ddd,#aaaa#)} maps to <?=htmlspecialchars($t->xxxx_xxxx($sss->ddd,"aaaa"))?>

  • Return: the result of the filtering
  • Access: public

Parameters:

string   $input     the template

[ Top ]

urlencoded_variables   [line 143]

string urlencoded_variables( string $input)

Urlencoded Variable replacement

Often when you use a WYSISYG editor, it replaces { in the href="{somevar}" with the urlencoded version, this bit fixes it.

Maps variables %??i.xyz%?? maps to <?=htmlspecialchars($i->xyz)?> %??i.xyz:h%?? maps to <?=$i->xyz?> %??i.xyz:u%?? maps to <?=urlencode($i->xyz)?> %??i.xyz:ru%?? maps to <?=urlencode($i->xyz)?> THIS IS PROBABLY THE ONE TO USE!

%??i.xyz:uu%?? maps to <?=urlencode(urlencode($i->xyz))?>

  • Return: the result of the filtering
  • Access: public

Parameters:

string   $input     the template

[ Top ]

variables   [line 88]

string variables( string $input)

Standard Variable replacement

Maps variables {i.xyz} maps to <?=htmlspecialchars($i->xyz)?> {i.xyz:h} maps to <?=$i->xyz?> {i.xyz:u} maps to <?=urlencode($i->xyz)?> {i.xyz:ru} maps to <?=rawurlencode($i->xyz)?>

{i.xyz:r} maps to

xyz)?>
{i.xyz:n} maps to <?=nl2br(htmlspecialchars($i->xyz))?>

  • Return: the result of the filtering
  • Access: public

Parameters:

string   $input     the template

[ Top ]


Documentation generated on Sun, 16 May 2004 05:18:15 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.