Location: PHPKode > projects > SithTemplate > SithTemplate-1.1/docs/html/class_template.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>SithTemplate: Template Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.2 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<h1>Template Class Reference</h1>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Template" -->
<p>Abstract base class for templates.  
<a href="#_details">More...</a></p>

<p><a href="class_template-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_template.html#a42044ff0ff501881954eaabce3da54ac">render</a> (array $ctx, <a class="el" href="class_template_environ.html">TemplateEnviron</a> $environ)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Render template using given context.  <a href="#a42044ff0ff501881954eaabce3da54ac"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_template.html#aa73df1171cfcbaf68597afc4d7b5fd63">_main</a> ($environ)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Contents of template's main block.  <a href="#aa73df1171cfcbaf68597afc4d7b5fd63"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_template.html#ac76489ff3a97c742e8bdebe3529a23df">warnVar</a> ($variable)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Warn about non-existant variable.  <a href="#ac76489ff3a97c742e8bdebe3529a23df"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_template.html#a7aab72ba46c77187e728cbb375ebe4fd">invalidVar</a> ($variable, $message)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fail after encountering an invalid variable (e.g.  <a href="#a7aab72ba46c77187e728cbb375ebe4fd"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_template.html#a350ff293455f5f877555eb2e1e0541aa">$ctx</a> = array()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Current context.  <a href="#a350ff293455f5f877555eb2e1e0541aa"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Abstract base class for templates. </p>

<p>Definition at line <a class="el" href="_base_8php_source.html#l00013">13</a> of file <a class="el" href="_base_8php_source.html">Base.php</a>.</p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a42044ff0ff501881954eaabce3da54ac"></a><!-- doxytag: member="Template::render" ref="a42044ff0ff501881954eaabce3da54ac" args="(array $ctx, TemplateEnviron $environ)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Template::render </td>
          <td>(</td>
          <td class="paramtype">array $&#160;</td>
          <td class="paramname"> <em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_template_environ.html">TemplateEnviron</a> $&#160;</td>
          <td class="paramname"> <em>environ</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [final]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Render template using given context. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">$ctx</td><td>Context (assoc. array with template variables) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">$environ</td><td>Environment to use (<a class="el" href="class_template_environ.html">TemplateEnviron</a> instance) </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Result as string </dd></dl>

<p>Definition at line <a class="el" href="_base_8php_source.html#l00026">26</a> of file <a class="el" href="_base_8php_source.html">Base.php</a>.</p>

<p>References <a class="el" href="_base_8php_source.html#l00017">$ctx</a>, and <a class="el" href="class_template.html#aa73df1171cfcbaf68597afc4d7b5fd63">_main()</a>.</p>

</div>
</div>
<a class="anchor" id="ac76489ff3a97c742e8bdebe3529a23df"></a><!-- doxytag: member="Template::warnVar" ref="ac76489ff3a97c742e8bdebe3529a23df" args="($variable)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Template::warnVar </td>
          <td>(</td>
          <td class="paramtype">$&#160;</td>
          <td class="paramname"> <em>variable</em>&#160;)</td>
          <td><code> [final, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Warn about non-existant variable. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">$variable</td><td>Raw variable name, as encountered in template source </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_base_8php_source.html#l00036">36</a> of file <a class="el" href="_base_8php_source.html">Base.php</a>.</p>

</div>
</div>
<a class="anchor" id="a7aab72ba46c77187e728cbb375ebe4fd"></a><!-- doxytag: member="Template::invalidVar" ref="a7aab72ba46c77187e728cbb375ebe4fd" args="($variable, $message)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Template::invalidVar </td>
          <td>(</td>
          <td class="paramtype">$&#160;</td>
          <td class="paramname"> <em>variable</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">$&#160;</td>
          <td class="paramname"> <em>message</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [final, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Fail after encountering an invalid variable (e.g. </p>
<p>non-iterable used as loop source).</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">$variable</td><td>Raw variable name, as encountered in template source </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">$message</td><td>Additional error details </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_base_8php_source.html#l00049">49</a> of file <a class="el" href="_base_8php_source.html">Base.php</a>.</p>

<p>References <a class="el" href="_error_8php_source.html#l00026">TemplateError::E_INVALID_VAR</a>.</p>

</div>
</div>
<a class="anchor" id="aa73df1171cfcbaf68597afc4d7b5fd63"></a><!-- doxytag: member="Template::_main" ref="aa73df1171cfcbaf68597afc4d7b5fd63" args="($environ)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Template::_main </td>
          <td>(</td>
          <td class="paramtype">$&#160;</td>
          <td class="paramname"> <em>environ</em>&#160;)</td>
          <td><code> [abstract]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Contents of template's main block. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">$environ</td><td><a class="el" href="class_template_environ.html">TemplateEnviron</a> instance </td></tr>
  </table>
  </dd>
</dl>

<p>Referenced by <a class="el" href="_base_8php_source.html#l00026">render()</a>.</p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a350ff293455f5f877555eb2e1e0541aa"></a><!-- doxytag: member="Template::$ctx" ref="a350ff293455f5f877555eb2e1e0541aa" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Template::$ctx = array()<code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Current context. </p>

<p>Definition at line <a class="el" href="_base_8php_source.html#l00017">17</a> of file <a class="el" href="_base_8php_source.html">Base.php</a>.</p>

<p>Referenced by <a class="el" href="_base_8php_source.html#l00026">render()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_base_8php_source.html">Base.php</a></li>
</ul>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 14 2011 20:08:37 for SithTemplate by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
Return current item: SithTemplate