Location: PHPKode > projects > SithTemplate > SithTemplate-1.1/docs/html/_base_8php_source.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: Base.php Source File</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><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><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="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>Base.php</h1>  </div>
</div>
<div class="contents">
<a href="_base_8php.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?php
<a name="l00013"></a><a class="code" href="class_template.html">00013</a> <span class="keyword">abstract</span> <span class="keyword">class </span><a class="code" href="class_template.html" title="Abstract base class for templates.">Template</a> {
<a name="l00017"></a><a class="code" href="class_template.html#a350ff293455f5f877555eb2e1e0541aa">00017</a>  <span class="keyword">protected</span> <a class="code" href="class_template.html#a350ff293455f5f877555eb2e1e0541aa" title="Current context.">$ctx</a> = array();
<a name="l00018"></a>00018  
<a name="l00026"></a><a class="code" href="class_template.html#a42044ff0ff501881954eaabce3da54ac">00026</a>  <span class="keyword">public</span> <span class="keyword">final</span> function <a class="code" href="class_template.html#a42044ff0ff501881954eaabce3da54ac" title="Render template using given context.">render</a>(array <a class="code" href="class_template.html#a350ff293455f5f877555eb2e1e0541aa" title="Current context.">$ctx</a>, <a class="code" href="class_template_environ.html" title="Template environment - library&amp;#39;s end-user API.">TemplateEnviron</a> $environ) {
<a name="l00027"></a>00027   $this-&gt;ctx = <a class="code" href="class_template.html#a350ff293455f5f877555eb2e1e0541aa" title="Current context.">$ctx</a>;
<a name="l00028"></a>00028   <span class="keywordflow">return</span> $this-&gt;<a class="code" href="class_template.html#aa73df1171cfcbaf68597afc4d7b5fd63" title="Contents of template&amp;#39;s main block.">_main</a>($environ);
<a name="l00029"></a>00029  }
<a name="l00030"></a>00030  
<a name="l00036"></a><a class="code" href="class_template.html#ac76489ff3a97c742e8bdebe3529a23df">00036</a>  <span class="keyword">protected</span> <span class="keyword">final</span> function <a class="code" href="class_template.html#ac76489ff3a97c742e8bdebe3529a23df" title="Warn about non-existant variable.">warnVar</a>($variable) {
<a name="l00037"></a>00037   trigger_error(
<a name="l00038"></a>00038    <span class="stringliteral">&#39;Non-existant variable &quot;&#39;</span>.$variable.<span class="stringliteral">&#39;&quot; used in template. Maybe a typo, or you forgot to include it in context?&#39;</span>,
<a name="l00039"></a>00039    E_USER_WARNING
<a name="l00040"></a>00040   );
<a name="l00041"></a>00041  }
<a name="l00042"></a>00042  
<a name="l00049"></a><a class="code" href="class_template.html#a7aab72ba46c77187e728cbb375ebe4fd">00049</a>  <span class="keyword">protected</span> <span class="keyword">final</span> function <a class="code" href="class_template.html#a7aab72ba46c77187e728cbb375ebe4fd" title="Fail after encountering an invalid variable (e.g.">invalidVar</a>($variable, $message) {
<a name="l00050"></a>00050   <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="class_template_error.html" title="Main and currently the only exception type thrown by SithTemplate internals.">TemplateError</a>(<span class="stringliteral">&#39;Invalid variable &quot;&#39;</span>.$variable.<span class="stringliteral">&#39;&quot; used: &#39;</span>.$message, <a class="code" href="class_template_error.html#aebcfd9326c60e1422bda01fb3f36c956" title="An invalid variable error.">TemplateError::E_INVALID_VAR</a>);
<a name="l00051"></a>00051  }
<a name="l00052"></a>00052  
<a name="l00058"></a>00058  <span class="keyword">abstract</span> function <a class="code" href="class_template.html#aa73df1171cfcbaf68597afc4d7b5fd63" title="Contents of template&amp;#39;s main block.">_main</a>($environ);
<a name="l00059"></a>00059 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 14 2011 20:08:36 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