summaryrefslogtreecommitdiff
path: root/docu/nd/files/stupid_template_engine-php.html
blob: 937b766827e07cbd246af14254b2c3b5cf564349 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>stupid_template_engine.php</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/prettify.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.52 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="stupid_template_engine.php"></a>stupid_template_engine.php</h1><div class=CBody><p>The implementation of the Stupid Template Engine.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#stupid_template_engine.php" >stupid_template_engine.php</a></td><td class=SDescription>The implementation of the Stupid Template Engine.</td></tr><tr class="SGeneric SMarked"><td class=SEntry><a href="#License" >License</a></td><td class=SDescription>This file is licensed under the MIT/X11 License. </td></tr><tr class="SClass"><td class=SEntry><a href="#ste" >ste</a></td><td class=SDescription>Everything in this file is in this namespace.</td></tr><tr class="SClass"><td class=SEntry><a href="#RuntimeError" >RuntimeError</a></td><td class=SDescription>An Exception that a tag can throw, if a non-fatal runtime error occurred. </td></tr><tr class="SClass"><td class=SEntry><a href="#FatalRuntimeError" >FatalRuntimeError</a></td><td class=SDescription>An Exception a tag can throw, if a fatal (irreparable) runtime error occurred. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#FatalRuntimeError.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#FatalRuntimeError.precompile" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">precompile</a></td><td class=SDescription>Precompiling STE T/PL templates. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#FatalRuntimeError.parse" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">parse</a></td><td class=SDescription>Parsing a STE T/PL template. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#FatalRuntimeError.transcompile" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">transcompile</a></td><td class=SDescription>Transcompiles an abstract syntax tree to PHP. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#FatalRuntimeError.Constants" >Constants</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent2 SMarked"><td class=SEntry><a href="#FatalRuntimeError.Template_modes" >Template modes</a></td><td class=SDescription></td></tr><tr class="SClass"><td class=SEntry><a href="#CantLoadTemplate" >CantLoadTemplate</a></td><td class=SDescription>An exception that a <a href="#StorageAccess" class=LClass id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">StorageAccess</a> implementation can throw, if it is unable to load a template.</td></tr><tr class="SClass"><td class=SEntry><a href="#CantSaveTemplate" >CantSaveTemplate</a></td><td class=SDescription>An exception that a <a href="#StorageAccess" class=LClass id=link5 onMouseOver="ShowTip(event, 'tt4', 'link5')" onMouseOut="HideTip('tt4')">StorageAccess</a> implementation can throw, if it is unable to save a template.</td></tr><tr class="SClass"><td class=SEntry><a href="#StorageAccess" >StorageAccess</a></td><td class=SDescription>An interface. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#StorageAccess.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#StorageAccess.load" id=link6 onMouseOver="ShowTip(event, 'tt5', 'link6')" onMouseOut="HideTip('tt5')">load</a></td><td class=SDescription>Loading a template.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#StorageAccess.save" id=link7 onMouseOver="ShowTip(event, 'tt6', 'link7')" onMouseOut="HideTip('tt6')">save</a></td><td class=SDescription>Saves a template.</td></tr><tr class="SClass"><td class=SEntry><a href="#FilesystemStorageAccess" >FilesystemStorageAccess</a></td><td class=SDescription>The default <a href="#StorageAccess" class=LClass id=link8 onMouseOver="ShowTip(event, 'tt4', 'link8')" onMouseOut="HideTip('tt4')">StorageAccess</a> implementation for loading / saving templates into a directory structure.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#FilesystemStorageAccess.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#FilesystemStorageAccess.__construct" id=link9 onMouseOver="ShowTip(event, 'tt7', 'link9')" onMouseOut="HideTip('tt7')">__construct</a></td><td class=SDescription></td></tr><tr class="SClass"><td class=SEntry><a href="#STECore" >STECore</a></td><td class=SDescription>The Core of STE</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#STECore.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#STECore.Public_variables" >Public variables</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#STECore.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#STECore.__construct" id=link10 onMouseOver="ShowTip(event, 'tt8', 'link10')" onMouseOut="HideTip('tt8')">__construct</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#STECore.register_tag" id=link11 onMouseOver="ShowTip(event, 'tt9', 'link11')" onMouseOut="HideTip('tt9')">register_tag</a></td><td class=SDescription>Register a custom tag.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#STECore.call_tag" id=link12 onMouseOver="ShowTip(event, 'tt10', 'link12')" onMouseOut="HideTip('tt10')">call_tag</a></td><td class=SDescription>Calling a custom tag (builtin ones can not be called)</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#STECore.exectemplate" id=link13 onMouseOver="ShowTip(event, 'tt11', 'link13')" onMouseOut="HideTip('tt11')">exectemplate</a></td><td class=SDescription>Executes a template and returns the result. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#STECore.get_var_reference" id=link14 onMouseOver="ShowTip(event, 'tt12', 'link14')" onMouseOut="HideTip('tt12')">get_var_reference</a></td><td class=SDescription>Get a reference to a template variable using a variable name. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#STECore.set_var_by_name" id=link15 onMouseOver="ShowTip(event, 'tt13', 'link15')" onMouseOut="HideTip('tt13')">set_var_by_name</a></td><td class=SDescription>Set a template variable by its name. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#STECore.get_var_by_name" id=link16 onMouseOver="ShowTip(event, 'tt14', 'link16')" onMouseOut="HideTip('tt14')">get_var_by_name</a></td><td class=SDescription>Get a template variable by its name. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#STECore.load" id=link17 onMouseOver="ShowTip(event, 'tt15', 'link17')" onMouseOut="HideTip('tt15')">load</a></td><td class=SDescription>Load a template and return its result (blocks not included, use <a href="#STECore.exectemplate" class=LFunction id=link18 onMouseOver="ShowTip(event, 'tt11', 'link18')" onMouseOut="HideTip('tt11')">exectemplate</a> for this).</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#STECore.evalbool" id=link19 onMouseOver="ShowTip(event, 'tt16', 'link19')" onMouseOut="HideTip('tt16')">evalbool</a></td><td class=SDescription>Test, if a text represents false (an empty / only whitespace text) or true (everything else).</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="License"></a>License</h3><div class=CBody><p>This file is licensed under the MIT/X11 License.&nbsp; See COPYING for more details.</p></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="ste"></a>ste</h2><div class=CBody><p>Everything in this file is in this namespace.</p></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="RuntimeError"></a>RuntimeError</h2><div class=CBody><p>An Exception that a tag can throw, if a non-fatal runtime error occurred.&nbsp; By default this will return in no output at all.&nbsp; But if <a href="#STECore.$mute_runtime_errors" class=LVariable id=link20 onMouseOver="ShowTip(event, 'tt17', 'link20')" onMouseOut="HideTip('tt17')">STECore::$mute_runtime_errors</a> is false, this will generate a error message instead of the tag&rsquo;s output.</p></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="FatalRuntimeError"></a>FatalRuntimeError</h2><div class=CBody><p>An Exception a tag can throw, if a fatal (irreparable) runtime error occurred.&nbsp; This Exception will always &ldquo;bubble up&rdquo; so you probably want to catch them.&nbsp; Remember that this exception is also in the namespace ste!</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#FatalRuntimeError.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#FatalRuntimeError.precompile" id=link21 onMouseOver="ShowTip(event, 'tt1', 'link21')" onMouseOut="HideTip('tt1')">precompile</a></td><td class=SDescription>Precompiling STE T/PL templates. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#FatalRuntimeError.parse" id=link22 onMouseOver="ShowTip(event, 'tt2', 'link22')" onMouseOut="HideTip('tt2')">parse</a></td><td class=SDescription>Parsing a STE T/PL template. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#FatalRuntimeError.transcompile" id=link23 onMouseOver="ShowTip(event, 'tt3', 'link23')" onMouseOut="HideTip('tt3')">transcompile</a></td><td class=SDescription>Transcompiles an abstract syntax tree to PHP. </td></tr><tr class="SGroup"><td class=SEntry><a href="#FatalRuntimeError.Constants" >Constants</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent1 SMarked"><td class=SEntry><a href="#FatalRuntimeError.Template_modes" >Template modes</a></td><td class=SDescription></td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="FatalRuntimeError.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FatalRuntimeError.precompile"></a>precompile</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>function precompile(</td><td class="PParameter  prettyprint " nowrap>$code</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Precompiling STE T/PL templates.&nbsp; You only need this function, if you want to manually transcompile a template.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$code</td><td class=CDLDescription>The input code</td></tr></table><h4 class=CHeading>Returns</h4><p>The precompiled code.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FatalRuntimeError.parse"></a>parse</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>function parse(</td><td class="PParameter  prettyprint " nowrap>$code,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$tpl</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Parsing a STE T/PL template.&nbsp; You only need this function, if you want to manually transcompile a template.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$code</td><td class=CDLDescription>The STE T/PL code.</td></tr><tr><td class=CDLEntry>$tpl</td><td class=CDLDescription>The name of the template.</td></tr></table><h4 class=CHeading>Returns</h4><p>An abstract syntax tree, which can be used with <a href="#FatalRuntimeError.transcompile" class=LFunction id=link24 onMouseOver="ShowTip(event, 'tt3', 'link24')" onMouseOut="HideTip('tt3')">transcompile</a>.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FatalRuntimeError.transcompile"></a>transcompile</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>function transcompile(</td><td class="PParameter  prettyprint " nowrap>$ast</td><td class="PAfterParameters  prettyprint "nowrap>) /* Transcompile and add some boilerplate code. */</td></tr></table></td></tr></table></blockquote><p>Transcompiles an abstract syntax tree to PHP.&nbsp; You only need this function, if you want to manually transcompile a template.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$ast</td><td class=CDLDescription>The abstract syntax tree to transcompile.</td></tr></table><h4 class=CHeading>Returns</h4><p>PHP code.&nbsp; The PHP code is an anonymous function expecting a <a href="#STECore" class=LClass id=link25 onMouseOver="ShowTip(event, 'tt18', 'link25')" onMouseOut="HideTip('tt18')">STECore</a> instance as its parameter and returns a string (everything that was not pached into a section).</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="FatalRuntimeError.Constants"></a>Constants</h3></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="FatalRuntimeError.Template_modes"></a>Template modes</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry><a name="FatalRuntimeError.MODE_SOURCE"></a>MODE_SOURCE</td><td class=CDLDescription>The Templates source</td></tr><tr><td class=CDLEntry><a name="FatalRuntimeError.MODE_TRANSCOMPILED"></a>MODE_TRANSCOMPILED</td><td class=CDLDescription>The transcompiled template</td></tr></table></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="CantLoadTemplate"></a>CantLoadTemplate</h2><div class=CBody><p>An exception that a <a href="#StorageAccess" class=LClass id=link26 onMouseOver="ShowTip(event, 'tt4', 'link26')" onMouseOut="HideTip('tt4')">StorageAccess</a> implementation can throw, if it is unable to load a template.</p></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="CantSaveTemplate"></a>CantSaveTemplate</h2><div class=CBody><p>An exception that a <a href="#StorageAccess" class=LClass id=link27 onMouseOver="ShowTip(event, 'tt4', 'link27')" onMouseOut="HideTip('tt4')">StorageAccess</a> implementation can throw, if it is unable to save a template.</p></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="StorageAccess"></a>StorageAccess</h2><div class=CBody><p>An interface.&nbsp; A StorageAccess implementation is used to access the templates from any storage.&nbsp; This means, that you are not limited to store the Templates inside directories, you can also use a database or something else.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#StorageAccess.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#StorageAccess.load" id=link28 onMouseOver="ShowTip(event, 'tt5', 'link28')" onMouseOut="HideTip('tt5')">load</a></td><td class=SDescription>Loading a template.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#StorageAccess.save" id=link29 onMouseOver="ShowTip(event, 'tt6', 'link29')" onMouseOut="HideTip('tt6')">save</a></td><td class=SDescription>Saves a template.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="StorageAccess.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="StorageAccess.load"></a>load</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function load(</td><td class="PParameterPrefix  prettyprint " nowrap></td><td class="PParameter  prettyprint " nowrap>$tpl,</td></tr><tr><td></td><td class="PParameterPrefix  prettyprint " nowrap>&amp;</td><td class="PParameter  prettyprint " nowrap>$mode</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Loading a template.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$tpl</td><td class=CDLDescription>The name of the template.</td></tr><tr><td class=CDLEntry>&amp;$mode</td><td class=CDLDescription>Which mode is preferred?&nbsp; One of the &lt;Template modes&gt;.&nbsp; If &lt;MODE_SOURCE&gt;, the raw sourcecode is expected, if &lt;MODE_TRANSCOMPILED&gt; the transcompiled template <b>as a callable function</b> (expecting an <a href="#STECore" class=LClass id=link30 onMouseOver="ShowTip(event, 'tt18', 'link30')" onMouseOut="HideTip('tt18')">STECore</a> instance as first parameter) is expected.&nbsp; If the transcompiled version is not available or older than the source, you can set this parameter to &lt;MODE_SOURCE&gt; and return the source.</td></tr></table><h4 class=CHeading>Throws</h4><p>A <a href="#CantLoadTemplate" class=LClass id=link31 onMouseOver="ShowTip(event, 'tt19', 'link31')" onMouseOut="HideTip('tt19')">CantLoadTemplate</a> exception if the template could not be loaded.</p><h4 class=CHeading>Returns</h4><p>Either the sourcecode or a callable function (first, and only parameter: an <a href="#STECore" class=LClass id=link32 onMouseOver="ShowTip(event, 'tt18', 'link32')" onMouseOut="HideTip('tt18')">STECore</a> instance).</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="StorageAccess.save"></a>save</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function save(</td><td class="PParameter  prettyprint " nowrap>$tpl,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$data,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$mode</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Saves a template.</p><h4 class=CHeading>Throws</h4><p>A <a href="#CantSaveTemplate" class=LClass id=link33 onMouseOver="ShowTip(event, 'tt20', 'link33')" onMouseOut="HideTip('tt20')">CantSaveTemplate</a> exception if the template could not be saved.</p><h4 class=CHeading>Parameters</h4><p>$tpl -The name of the template.&nbsp; $data - The data to be saved.&nbsp; $mode - A &lt;Template mode&gt; constant.</p></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="FilesystemStorageAccess"></a>FilesystemStorageAccess</h2><div class=CBody><p>The default <a href="#StorageAccess" class=LClass id=link35 onMouseOver="ShowTip(event, 'tt4', 'link35')" onMouseOut="HideTip('tt4')">StorageAccess</a> implementation for loading / saving templates into a directory structure.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#FilesystemStorageAccess.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#FilesystemStorageAccess.__construct" id=link34 onMouseOver="ShowTip(event, 'tt7', 'link34')" onMouseOut="HideTip('tt7')">__construct</a></td><td class=SDescription></td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="FilesystemStorageAccess.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FilesystemStorageAccess.__construct"></a>__construct</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function __construct(</td><td class="PParameter  prettyprint " nowrap>$src,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$transc</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$src</td><td class=CDLDescription>The directory with the sources (Writing permissions are not mandatory, because STE does not save template sources).</td></tr><tr><td class=CDLEntry>$transc</td><td class=CDLDescription>The directory with the transcompiled templates (the PHP instance / the HTTP Server needs writing permissions to this directory).</td></tr></table></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="STECore"></a>STECore</h2><div class=CBody><p>The Core of STE</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#STECore.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent1 SMarked"><td class=SEntry><a href="#STECore.Public_variables" >Public variables</a></td><td class=SDescription></td></tr><tr class="SGroup"><td class=SEntry><a href="#STECore.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#STECore.__construct" id=link36 onMouseOver="ShowTip(event, 'tt8', 'link36')" onMouseOut="HideTip('tt8')">__construct</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#STECore.register_tag" id=link37 onMouseOver="ShowTip(event, 'tt9', 'link37')" onMouseOut="HideTip('tt9')">register_tag</a></td><td class=SDescription>Register a custom tag.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#STECore.call_tag" id=link38 onMouseOver="ShowTip(event, 'tt10', 'link38')" onMouseOut="HideTip('tt10')">call_tag</a></td><td class=SDescription>Calling a custom tag (builtin ones can not be called)</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#STECore.exectemplate" id=link39 onMouseOver="ShowTip(event, 'tt11', 'link39')" onMouseOut="HideTip('tt11')">exectemplate</a></td><td class=SDescription>Executes a template and returns the result. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#STECore.get_var_reference" id=link40 onMouseOver="ShowTip(event, 'tt12', 'link40')" onMouseOut="HideTip('tt12')">get_var_reference</a></td><td class=SDescription>Get a reference to a template variable using a variable name. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#STECore.set_var_by_name" id=link41 onMouseOver="ShowTip(event, 'tt13', 'link41')" onMouseOut="HideTip('tt13')">set_var_by_name</a></td><td class=SDescription>Set a template variable by its name. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#STECore.get_var_by_name" id=link42 onMouseOver="ShowTip(event, 'tt14', 'link42')" onMouseOut="HideTip('tt14')">get_var_by_name</a></td><td class=SDescription>Get a template variable by its name. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#STECore.load" id=link43 onMouseOver="ShowTip(event, 'tt15', 'link43')" onMouseOut="HideTip('tt15')">load</a></td><td class=SDescription>Load a template and return its result (blocks not included, use <a href="#STECore.exectemplate" class=LFunction id=link44 onMouseOver="ShowTip(event, 'tt11', 'link44')" onMouseOut="HideTip('tt11')">exectemplate</a> for this).</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#STECore.evalbool" id=link45 onMouseOver="ShowTip(event, 'tt16', 'link45')" onMouseOut="HideTip('tt16')">evalbool</a></td><td class=SDescription>Test, if a text represents false (an empty / only whitespace text) or true (everything else).</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="STECore.Variables"></a>Variables</h3></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="STECore.Public_variables"></a>Public variables</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry><a name="STECore.$blocks"></a>$blocks</td><td class=CDLDescription>Associative array of blocks (see the language definition).</td></tr><tr><td class=CDLEntry><a name="STECore.$blockorder"></a>$blockorder</td><td class=CDLDescription>The order of the blocks (an array)</td></tr><tr><td class=CDLEntry><a name="STECore.$vars"></a>$vars</td><td class=CDLDescription>Associative array of all template variables.&nbsp; Use this to pass data to your templates.</td></tr><tr><td class=CDLEntry><a name="STECore.$mute_runtime_errors"></a>$mute_runtime_errors</td><td class=CDLDescription>If True (default) a <a href="#RuntimeError" class=LClass id=link46 onMouseOver="ShowTip(event, 'tt21', 'link46')" onMouseOut="HideTip('tt21')">RuntimeError</a> exception will result in no output from the tag, if False a error message will be written to output.</td></tr><tr><td class=CDLEntry><a name="STECore.$fatal_error_on_missing_tag"></a>$fatal_error_on_missing_tag</td><td class=CDLDescription>If True, STE will throw a <a href="#FatalRuntimeError" class=LClass id=link47 onMouseOver="ShowTip(event, 'tt22', 'link47')" onMouseOut="HideTip('tt22')">FatalRuntimeError</a> if a tag was called that was not registered, otherwise (default) a regular <a href="#RuntimeError" class=LClass id=link48 onMouseOver="ShowTip(event, 'tt21', 'link48')" onMouseOut="HideTip('tt21')">RuntimeError</a> will be thrown and automatically handled by STE (see <a href="#STECore.$mute_runtime_errors" class=LVariable id=link49 onMouseOver="ShowTip(event, 'tt17', 'link49')" onMouseOut="HideTip('tt17')">$mute_runtime_errors</a>).</td></tr></table></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="STECore.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="STECore.__construct"></a>__construct</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function __construct(</td><td class="PParameter  prettyprint " nowrap>$storage_access</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$storage_access</td><td class=CDLDescription>An Instance of a <a href="#StorageAccess" class=LClass id=link50 onMouseOver="ShowTip(event, 'tt4', 'link50')" onMouseOut="HideTip('tt4')">StorageAccess</a> implementation.</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="STECore.register_tag"></a>register_tag</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function register_tag(</td><td class="PParameter  prettyprint " nowrap>$name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$callback</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Register a custom tag.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$name</td><td class=CDLDescription>The name of the tag.</td></tr><tr><td class=CDLEntry>$callback</td><td class=CDLDescription>A callable function (This must take three parameters: The <a href="#STECore" class=LClass id=link51 onMouseOver="ShowTip(event, 'tt18', 'link51')" onMouseOut="HideTip('tt18')">STECore</a> instance, an associative array of parameters, and a function representing the tags content(This expects the <a href="#STECore" class=LClass id=link52 onMouseOver="ShowTip(event, 'tt18', 'link52')" onMouseOut="HideTip('tt18')">STECore</a> instance as its only parameter and returns its text result, i.e to get the text, you neeed to call this function with the <a href="#STECore" class=LClass id=link53 onMouseOver="ShowTip(event, 'tt18', 'link53')" onMouseOut="HideTip('tt18')">STECore</a> instance as a parameter)).</td></tr></table><h4 class=CHeading>Throws</h4><p>An Exception if the tag could not be registered (if $callback is not callable or if $name is empty)</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="STECore.call_tag"></a>call_tag</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function call_tag(</td><td class="PParameter  prettyprint " nowrap>$name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$params,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$sub</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Calling a custom tag (builtin ones can not be called)</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$name</td><td class=CDLDescription>The Tag&rsquo;s name</td></tr><tr><td class=CDLEntry>$params</td><td class=CDLDescription>Associative array of parameters</td></tr><tr><td class=CDLEntry>$sub</td><td class=CDLDescription>A callable function (expecting an <a href="#STECore" class=LClass id=link54 onMouseOver="ShowTip(event, 'tt18', 'link54')" onMouseOut="HideTip('tt18')">STECore</a> instance as it&rsquo;s parameter) that represents the tag&rsquo;s content.</td></tr></table><h4 class=CHeading>Throws</h4><p>Might throw a <a href="#FatalRuntimeError" class=LClass id=link55 onMouseOver="ShowTip(event, 'tt22', 'link55')" onMouseOut="HideTip('tt22')">FatalRuntimeError</a> (see <a href="#STECore.$fatal_error_on_missing_tag" class=LVariable id=link56 onMouseOver="ShowTip(event, 'tt23', 'link56')" onMouseOut="HideTip('tt23')">$fatal_error_on_missing_tag</a>.</p><h4 class=CHeading>Returns</h4><p>The output of the tag or, if a <a href="#RuntimeError" class=LClass id=link57 onMouseOver="ShowTip(event, 'tt21', 'link57')" onMouseOut="HideTip('tt21')">RuntimeError</a> was thrown, the appropiate result (see <a href="#STECore.$mute_runtime_errors" class=LVariable id=link58 onMouseOver="ShowTip(event, 'tt17', 'link58')" onMouseOut="HideTip('tt17')">$mute_runtime_errors</a>).</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="STECore.exectemplate"></a>exectemplate</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function exectemplate(</td><td class="PParameter  prettyprint " nowrap>$tpl</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Executes a template and returns the result.&nbsp; The huge difference to <a href="#STECore.load" class=LFunction id=link59 onMouseOver="ShowTip(event, 'tt15', 'link59')" onMouseOut="HideTip('tt15')">load</a> is that this function will also output all blocks.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$tpl</td><td class=CDLDescription>The name of the template to execute.</td></tr></table><h4 class=CHeading>Throws</h4><ul><li>A <a href="#CantLoadTemplate" class=LClass id=link60 onMouseOver="ShowTip(event, 'tt19', 'link60')" onMouseOut="HideTip('tt19')">CantLoadTemplate</a> exception if the template could not be loaded.</li><li>A &lt;ParseCompileError&gt; if the template could not be parsed or transcompiled.</li><li>A <a href="#FatalRuntimeError" class=LClass id=link61 onMouseOver="ShowTip(event, 'tt22', 'link61')" onMouseOut="HideTip('tt22')">FatalRuntimeError</a> if a tag threw it or if a tag was not found and <a href="#STECore.$fatal_error_on_missing_tag" class=LVariable id=link62 onMouseOver="ShowTip(event, 'tt23', 'link62')" onMouseOut="HideTip('tt23')">$fatal_error_on_missing_tag</a> is true.</li><li>Might also throw different exceptions, if a external tag threw it (but they should use <a href="#RuntimeError" class=LClass id=link63 onMouseOver="ShowTip(event, 'tt21', 'link63')" onMouseOut="HideTip('tt21')">RuntimeError</a> or <a href="#FatalRuntimeError" class=LClass id=link64 onMouseOver="ShowTip(event, 'tt22', 'link64')" onMouseOut="HideTip('tt22')">FatalRuntimeError</a> to make it possible for STE to handle them correctly).</li></ul><h4 class=CHeading>Returns</h4><p>The output of the template.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="STECore.get_var_reference"></a>get_var_reference</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function &amp;get_var_reference(</td><td class="PParameter  prettyprint " nowrap>$name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$create_if_not_exist</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get a reference to a template variable using a variable name.&nbsp; This can be used,if your custom tag takes a variable name as a parameter.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$name</td><td class=CDLDescription>The variables name.</td></tr><tr><td class=CDLEntry>$create_if_not_exist</td><td class=CDLDescription>Should the variable be created, if it does not exist?&nbsp; Otherwise NULL will be returned, if the variable does not exist.</td></tr></table><h4 class=CHeading>Throws</h4><p><a href="#RuntimeError" class=LClass id=link65 onMouseOver="ShowTip(event, 'tt21', 'link65')" onMouseOut="HideTip('tt21')">RuntimeError</a> if the variable name can not be parsed (e.g. unbalanced brackets).</p><h4 class=CHeading>Returns</h4><p>A Reference to the variable.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="STECore.set_var_by_name"></a>set_var_by_name</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function set_var_by_name(</td><td class="PParameter  prettyprint " nowrap>$name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$val</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Set a template variable by its name.&nbsp; This can be used,if your custom tag takes a variable name as a parameter.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$name</td><td class=CDLDescription>The variables name.</td></tr><tr><td class=CDLEntry>$val</td><td class=CDLDescription>The new value.</td></tr></table><h4 class=CHeading>Throws</h4><p><a href="#RuntimeError" class=LClass id=link66 onMouseOver="ShowTip(event, 'tt21', 'link66')" onMouseOut="HideTip('tt21')">RuntimeError</a> if the variable name can not be parsed (e.g. unbalanced brackets).</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="STECore.get_var_by_name"></a>get_var_by_name</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function get_var_by_name(</td><td class="PParameter  prettyprint " nowrap>$name</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get a template variable by its name.&nbsp; This can be used,if your custom tag takes a variable name as a parameter.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$name</td><td class=CDLDescription>The variables name.</td></tr></table><h4 class=CHeading>Throws</h4><p><a href="#RuntimeError" class=LClass id=link67 onMouseOver="ShowTip(event, 'tt21', 'link67')" onMouseOut="HideTip('tt21')">RuntimeError</a> if the variable name can not be parsed (e.g. unbalanced brackets).</p><h4 class=CHeading>Returns</h4><p>The variables value.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="STECore.load"></a>load</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function load(</td><td class="PParameter  prettyprint " nowrap>$tpl,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$quiet</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%>False</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Load a template and return its result (blocks not included, use <a href="#STECore.exectemplate" class=LFunction id=link68 onMouseOver="ShowTip(event, 'tt11', 'link68')" onMouseOut="HideTip('tt11')">exectemplate</a> for this).</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$tpl</td><td class=CDLDescription>The name of the template to be loaded.</td></tr><tr><td class=CDLEntry>$quiet</td><td class=CDLDescription>If true, do not output anything and do notmodify the blocks.&nbsp; This can be useful to load custom tags that are programmed in STE T/PL.&nbsp; Default: false.</td></tr></table><h4 class=CHeading>Throws</h4><ul><li>A <a href="#CantLoadTemplate" class=LClass id=link69 onMouseOver="ShowTip(event, 'tt19', 'link69')" onMouseOut="HideTip('tt19')">CantLoadTemplate</a> exception if the template could not be loaded.</li><li>A &lt;ParseCompileError&gt; if the template could not be parsed or transcompiled.</li><li>A <a href="#FatalRuntimeError" class=LClass id=link70 onMouseOver="ShowTip(event, 'tt22', 'link70')" onMouseOut="HideTip('tt22')">FatalRuntimeError</a> if a tag threw it or if a tag was not found and <a href="#STECore.$fatal_error_on_missing_tag" class=LVariable id=link71 onMouseOver="ShowTip(event, 'tt23', 'link71')" onMouseOut="HideTip('tt23')">$fatal_error_on_missing_tag</a> is true.</li><li>Might also throw different exceptions, if a external tag threw it (but they should use <a href="#RuntimeError" class=LClass id=link72 onMouseOver="ShowTip(event, 'tt21', 'link72')" onMouseOut="HideTip('tt21')">RuntimeError</a> or <a href="#FatalRuntimeError" class=LClass id=link73 onMouseOver="ShowTip(event, 'tt22', 'link73')" onMouseOut="HideTip('tt22')">FatalRuntimeError</a> to make it possible for STE to handle them correctly).</li></ul><h4 class=CHeading>Returns</h4><p>The result of the template (if $quiet == false).</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="STECore.evalbool"></a>evalbool</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function evalbool(</td><td class="PParameter  prettyprint " nowrap>$txt</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Test, if a text represents false (an empty / only whitespace text) or true (everything else).</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$txt</td><td class=CDLDescription>The text to test.</td></tr></table><h4 class=CHeading>Returns</h4><p>true/false.</p></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MEntry><div class=MFile id=MSelected>stupid_template_engine.php</div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Index</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Constants.html">Constants</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Variables.html">Variables</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Constants">Constants</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Variables">Variables</option></select></div></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>function precompile(</td><td class="PParameter  prettyprint " nowrap>$code</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Precompiling STE T/PL templates. </div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>function parse(</td><td class="PParameter  prettyprint " nowrap>$code,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$tpl</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Parsing a STE T/PL template. </div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>function transcompile(</td><td class="PParameter  prettyprint " nowrap>$ast</td><td class="PAfterParameters  prettyprint "nowrap>) /* Transcompile and add some boilerplate code. */</td></tr></table></td></tr></table></blockquote>Transcompiles an abstract syntax tree to PHP. </div></div><div class=CToolTip id="tt4"><div class=CClass>An interface. </div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function load(</td><td class="PParameterPrefix  prettyprint " nowrap></td><td class="PParameter  prettyprint " nowrap>$tpl,</td></tr><tr><td></td><td class="PParameterPrefix  prettyprint " nowrap>&amp;</td><td class="PParameter  prettyprint " nowrap>$mode</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Loading a template.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function save(</td><td class="PParameter  prettyprint " nowrap>$tpl,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$data,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$mode</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Saves a template.</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function __construct(</td><td class="PParameter  prettyprint " nowrap>$src,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$transc</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function __construct(</td><td class="PParameter  prettyprint " nowrap>$storage_access</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function register_tag(</td><td class="PParameter  prettyprint " nowrap>$name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$callback</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Register a custom tag.</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function call_tag(</td><td class="PParameter  prettyprint " nowrap>$name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$params,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$sub</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Calling a custom tag (builtin ones can not be called)</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function exectemplate(</td><td class="PParameter  prettyprint " nowrap>$tpl</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Executes a template and returns the result. </div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function &amp;get_var_reference(</td><td class="PParameter  prettyprint " nowrap>$name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$create_if_not_exist</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Get a reference to a template variable using a variable name. </div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function set_var_by_name(</td><td class="PParameter  prettyprint " nowrap>$name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$val</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Set a template variable by its name. </div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function get_var_by_name(</td><td class="PParameter  prettyprint " nowrap>$name</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Get a template variable by its name. </div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function load(</td><td class="PParameter  prettyprint " nowrap>$tpl,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>$quiet</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%>False</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Load a template and return its result (blocks not included, use exectemplate for this).</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function evalbool(</td><td class="PParameter  prettyprint " nowrap>$txt</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Test, if a text represents false (an empty / only whitespace text) or true (everything else).</div></div><div class=CToolTip id="tt17"><div class=CVariable>If True (default) a RuntimeError exception will result in no output from the tag, if False a error message will be written to output.</div></div><div class=CToolTip id="tt18"><div class=CClass>The Core of STE</div></div><div class=CToolTip id="tt19"><div class=CClass>An exception that a StorageAccess implementation can throw, if it is unable to load a template.</div></div><div class=CToolTip id="tt20"><div class=CClass>An exception that a StorageAccess implementation can throw, if it is unable to save a template.</div></div><div class=CToolTip id="tt21"><div class=CClass>An Exception that a tag can throw, if a non-fatal runtime error occurred. </div></div><div class=CToolTip id="tt22"><div class=CClass>An Exception a tag can throw, if a fatal (irreparable) runtime error occurred. </div></div><div class=CToolTip id="tt23"><div class=CVariable>If True, STE will throw a FatalRuntimeError if a tag was called that was not registered, otherwise (default) a regular RuntimeError will be thrown and automatically handled by STE (see $mute_runtime_errors).</div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>