663 lines
13 KiB
HTML
663 lines
13 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="generator" content="ApiGen 2.8.0" />
|
|
|
|
<title>Class Slim\View | GeoApi</title>
|
|
|
|
<script type="text/javascript" src="resources/combined.js?112270826"></script>
|
|
<script type="text/javascript" src="elementlist.js?4049681226"></script>
|
|
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360" />
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<div id="left">
|
|
<div id="menu">
|
|
<a href="index.html" title="Overview"><span>Overview</span></a>
|
|
|
|
|
|
<div id="groups">
|
|
<h3>Namespaces</h3>
|
|
<ul>
|
|
<li><a href="namespace-None.html">None</a>
|
|
</li>
|
|
<li><a href="namespace-PHP.html">PHP</a>
|
|
</li>
|
|
<li class="active"><a href="namespace-Slim.html">Slim<span></span></a>
|
|
<ul>
|
|
<li><a href="namespace-Slim.Exception.html">Exception</a>
|
|
</li>
|
|
<li><a href="namespace-Slim.Http.html">Http</a>
|
|
</li>
|
|
<li><a href="namespace-Slim.Middleware.html">Middleware</a>
|
|
</li>
|
|
</ul></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<hr />
|
|
|
|
|
|
<div id="elements">
|
|
<h3>Classes</h3>
|
|
<ul>
|
|
<li><a href="class-Slim.Environment.html">Environment</a></li>
|
|
<li><a href="class-Slim.Log.html">Log</a></li>
|
|
<li><a href="class-Slim.LogWriter.html">LogWriter</a></li>
|
|
<li><a href="class-Slim.Middleware.html">Middleware</a></li>
|
|
<li><a href="class-Slim.Route.html">Route</a></li>
|
|
<li><a href="class-Slim.Router.html">Router</a></li>
|
|
<li><a href="class-Slim.Slim.html">Slim</a></li>
|
|
<li class="active"><a href="class-Slim.View.html">View</a></li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="splitter"></div>
|
|
|
|
<div id="right">
|
|
<div id="rightInner">
|
|
<form id="search">
|
|
<input type="hidden" name="cx" value="" />
|
|
<input type="hidden" name="ie" value="UTF-8" />
|
|
<input type="text" name="q" class="text" />
|
|
<input type="submit" value="Search" />
|
|
</form>
|
|
|
|
<div id="navigation">
|
|
<ul>
|
|
<li>
|
|
<a href="index.html" title="Overview"><span>Overview</span></a>
|
|
</li>
|
|
<li>
|
|
<a href="namespace-Slim.html" title="Summary of Slim"><span>Namespace</span></a>
|
|
</li>
|
|
<li class="active">
|
|
<span>Class</span> </li>
|
|
</ul>
|
|
<ul>
|
|
<li>
|
|
<a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
</ul>
|
|
</div>
|
|
|
|
<div id="content" class="class">
|
|
<h1>Class View</h1>
|
|
|
|
|
|
<div class="description">
|
|
|
|
<p>View</p>
|
|
|
|
<p>The view is responsible for rendering a template. The view should subclass
|
|
\Slim\View and implement this interface:</p>
|
|
|
|
<p>public render(string $template);</p>
|
|
|
|
<p>This method should render the specified template and return the resultant
|
|
string.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="info">
|
|
|
|
|
|
<b>Namespace:</b> <a href="namespace-Slim.html">Slim</a><br />
|
|
<b>Package:</b> Slim<br />
|
|
|
|
<b>Author:</b>
|
|
Josh Lockhart<br />
|
|
<b>Since:</b>
|
|
1.0.0<br />
|
|
<b>Located at</b> <a href="source-class-Slim.View.html#35-216" title="Go to source code">thirdparty/Slim/View.php</a><br />
|
|
</div>
|
|
|
|
|
|
|
|
<table class="summary" id="methods">
|
|
<caption>Methods summary</caption>
|
|
<tr data-order="__construct" id="___construct">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#___construct">#</a>
|
|
<code><a href="source-class-Slim.View.html#70-78" title="Go to source code">__construct</a>( )</code>
|
|
|
|
<div class="description short">
|
|
|
|
<p>Constructor</p>
|
|
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
|
|
<p>Constructor</p>
|
|
|
|
<p>This is empty but may be implemented in a subclass</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="getData" id="_getData">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
mixed
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_getData">#</a>
|
|
<code><a href="source-class-Slim.View.html#80-94" title="Go to source code">getData</a>( <span>string|null <var>$key</var> = <span class="php-keyword1">null</span></span> )</code>
|
|
|
|
<div class="description short">
|
|
|
|
<p>Get data</p>
|
|
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
|
|
<p>Get data</p>
|
|
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$key</var></dt>
|
|
<dd><code>string|null</code><br>$key</dd>
|
|
</dl></div>
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
<code>mixed</code><br>If key is null, array of template data; If key exists, value of datum with key;
|
|
If key does not exist, null;<br />
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="setData" id="_setData">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_setData">#</a>
|
|
<code><a href="source-class-Slim.View.html#96-123" title="Go to source code">setData</a>( )</code>
|
|
|
|
<div class="description short">
|
|
|
|
<p>Set data</p>
|
|
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
|
|
<p>Set data</p>
|
|
|
|
<p>If two arguments: A single datum with key is assigned value;<br />
|
|
$view->setData('color', 'red');</p>
|
|
|
|
<p>If one argument: Replace all data with provided array keys and values;<br />
|
|
$view->setData(array('color' => 'red', 'number' => 1));</p>
|
|
|
|
|
|
|
|
|
|
|
|
<h4>Throws</h4>
|
|
<div class="list">
|
|
<code><code><a href="class-InvalidArgumentException.html">InvalidArgumentException</a></code></code><br>If incorrect method signature<br />
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="appendData" id="_appendData">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_appendData">#</a>
|
|
<code><a href="source-class-Slim.View.html#125-136" title="Go to source code">appendData</a>( <span>array <var>$data</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
|
|
<p>Append new data to existing template data</p>
|
|
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
|
|
<p>Append new data to existing template data</p>
|
|
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$data</var></dt>
|
|
<dd><code>array</code></dd>
|
|
</dl></div>
|
|
|
|
|
|
<h4>Throws</h4>
|
|
<div class="list">
|
|
<code><code><a href="class-InvalidArgumentException.html">InvalidArgumentException</a></code></code><br>If not given an array argument<br />
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="getTemplatesDirectory" id="_getTemplatesDirectory">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
string|null
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_getTemplatesDirectory">#</a>
|
|
<code><a href="source-class-Slim.View.html#138-146" title="Go to source code">getTemplatesDirectory</a>( )</code>
|
|
|
|
<div class="description short">
|
|
|
|
<p>Get templates directory</p>
|
|
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
|
|
<p>Get templates directory</p>
|
|
|
|
|
|
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
<code>string|null</code><br>Path to templates directory without trailing slash; Returns null if templates
|
|
directory not set;<br />
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="setTemplatesDirectory" id="_setTemplatesDirectory">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_setTemplatesDirectory">#</a>
|
|
<code><a href="source-class-Slim.View.html#148-155" title="Go to source code">setTemplatesDirectory</a>( <span>string <var>$dir</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
|
|
<p>Set templates directory</p>
|
|
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
|
|
<p>Set templates directory</p>
|
|
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$dir</var></dt>
|
|
<dd><code>string</code><br>$dir</dd>
|
|
</dl></div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="setTemplate" id="_setTemplate">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_setTemplate">#</a>
|
|
<code><a href="source-class-Slim.View.html#157-171" title="Go to source code">setTemplate</a>( <span>string <var>$template</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
|
|
<p>Set template</p>
|
|
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
|
|
<p>Set template</p>
|
|
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$template</var></dt>
|
|
<dd><code>string</code><br>$template</dd>
|
|
</dl></div>
|
|
|
|
|
|
<h4>Throws</h4>
|
|
<div class="list">
|
|
<code><code><a href="class-RuntimeException.html">RuntimeException</a></code></code><br>If template file does not exist DEPRECATION WARNING! This method will be removed
|
|
in the near future.<br />
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="display" id="_display">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_display">#</a>
|
|
<code><a href="source-class-Slim.View.html#173-183" title="Go to source code">display</a>( <span>string <var>$template</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
|
|
<p>Display template</p>
|
|
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
|
|
<p>Display template</p>
|
|
|
|
<p>This method echoes the rendered template to the current output buffer</p>
|
|
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$template</var></dt>
|
|
<dd><code>string</code><br>$template Pathname of template file relative to templates directoy</dd>
|
|
</dl></div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="fetch" id="_fetch">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
string
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_fetch">#</a>
|
|
<code><a href="source-class-Slim.View.html#185-196" title="Go to source code">fetch</a>( <span>string <var>$template</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
|
|
<p>Fetch rendered template</p>
|
|
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
|
|
<p>Fetch rendered template</p>
|
|
|
|
<p>This method returns the rendered template</p>
|
|
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$template</var></dt>
|
|
<dd><code>string</code><br>$template Pathname of template file relative to templates directory</dd>
|
|
</dl></div>
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
<code>string</code><br />
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="render" id="_render">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
string
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_render">#</a>
|
|
<code><a href="source-class-Slim.View.html#198-215" title="Go to source code">render</a>( <span>string <var>$template</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
|
|
<p>Render template</p>
|
|
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
|
|
<p>Render template</p>
|
|
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$template</var></dt>
|
|
<dd><code>string</code><br>$template Pathname of template file relative to templates directory</dd>
|
|
</dl></div>
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
<code>string</code><br>DEPRECATION WARNING! Use <code>\Slim\View::fetch</code> to return a rendered
|
|
template instead of <code>\Slim\View::render</code>.<br />
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<table class="summary" id="properties">
|
|
<caption>Properties summary</caption>
|
|
<tr data-order="templatePath" id="$templatePath">
|
|
<td class="attributes"><code>
|
|
protected
|
|
string
|
|
</code></td>
|
|
|
|
<td class="name">
|
|
<a href="source-class-Slim.View.html#52-58" title="Go to source code"><var>$templatePath</var></a>
|
|
</td>
|
|
<td class="value"><code><span class="php-quote">''</span></code></td>
|
|
<td class="description"><div>
|
|
<a href="#$templatePath" class="anchor">#</a>
|
|
|
|
<div class="description short">
|
|
|
|
<p>Absolute or relative filesystem path to a specific template</p>
|
|
|
|
<p>DEPRECATION WARNING! This variable will be removed in the near future</p>
|
|
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
|
|
<p>Absolute or relative filesystem path to a specific template</p>
|
|
|
|
<p>DEPRECATION WARNING! This variable will be removed in the near future</p>
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="data" id="$data">
|
|
<td class="attributes"><code>
|
|
protected
|
|
array
|
|
</code></td>
|
|
|
|
<td class="name">
|
|
<a href="source-class-Slim.View.html#60-63" title="Go to source code"><var>$data</var></a>
|
|
</td>
|
|
<td class="value"><code><span class="php-keyword1">array</span>()</code></td>
|
|
<td class="description"><div>
|
|
<a href="#$data" class="anchor">#</a>
|
|
|
|
<div class="description short">
|
|
|
|
<p>Associative array of template variables</p>
|
|
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
|
|
<p>Associative array of template variables</p>
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="templatesDirectory" id="$templatesDirectory">
|
|
<td class="attributes"><code>
|
|
protected
|
|
string
|
|
</code></td>
|
|
|
|
<td class="name">
|
|
<a href="source-class-Slim.View.html#65-68" title="Go to source code"><var>$templatesDirectory</var></a>
|
|
</td>
|
|
<td class="value"><code></code></td>
|
|
<td class="description"><div>
|
|
<a href="#$templatesDirectory" class="anchor">#</a>
|
|
|
|
<div class="description short">
|
|
|
|
<p>Absolute or relative path to the application's templates directory</p>
|
|
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
|
|
<p>Absolute or relative path to the application's templates directory</p>
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div id="footer">
|
|
GeoApi API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|