atelierspierrot/patterns

View on GitHub
phpdoc/Patterns/Traits/TemplateViewTrait.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="robots" content="index, follow, all" />
    <title>Patterns\Traits\TemplateViewTrait | Patterns</title>

            <link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="../../css/bootstrap-theme.min.css">
        <link rel="stylesheet" type="text/css" href="../../css/sami.css">
        <script src="../../js/jquery-1.11.1.min.js"></script>
        <script src="../../js/bootstrap.min.js"></script>
        <script src="../../js/typeahead.min.js"></script>
        <script src="../../sami.js"></script>
        <meta name="MobileOptimized" content="width">
        <meta name="HandheldFriendly" content="true">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
    
    
    </head>

    <body id="class" data-name="class:Patterns_Traits_TemplateViewTrait" data-root-path="../../">
            <div id="content">
        <div id="left-column">
                <div id="control-panel">
                <form id="search-form" action="../../search.html" method="GET">
            <span class="glyphicon glyphicon-search"></span>
            <input name="search"
                   class="typeahead form-control"
                   type="search"
                   placeholder="Search">
        </form>
    </div>

                <div id="api-tree"></div>

        </div>
        <div id="right-column">
                <nav id="site-nav" class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-elements">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="../../index.html">Patterns</a>
            </div>
            <div class="collapse navbar-collapse" id="navbar-elements">
                <ul class="nav navbar-nav">
                    <li><a href="../../classes.html">Classes</a></li>
                                            <li><a href="../../namespaces.html">Namespaces</a></li>
                                        <li><a href="../../interfaces.html">Interfaces</a></li>
                    <li><a href="../../traits.html">Traits</a></li>
                    <li><a href="../../doc-index.html">Index</a></li>
                    <li><a href="../../search.html">Search</a></li>
                </ul>
            </div>
        </div>
    </nav>

                        <div class="namespace-breadcrumbs">
            <ol class="breadcrumb">
                <li><span class="label label-default">trait</span></li>
                                                            <li><a href="../../Patterns.html">Patterns</a></li>
                                        <li><a href="../../Patterns/Traits.html">Traits</a></li>
    
                <li>TemplateViewTrait</li>
            </ol>
        </div>
                <div id="page-content">
                
    <div class="page-header">
        <h1>TemplateViewTrait</h1>
    </div>

    <p>    trait
    <strong>TemplateViewTrait</strong>
</p>

            <div class="description">
            <p>This trait is the exact copy of the <code>\Patterns\Abstracts\AbstractView</code> class.</p>            <p>It MUST be updated with it each time.</p>        </div>
    
    
    
    
            <h2>Methods</h2>

            <div class="container-fluid underlined">
                    <div class="row">
                <div class="col-md-2 type">
                    
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_setView">setView</a>(
    string $path)
                                            <p>Set the view name to parse</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    string
                </div>
                <div class="col-md-8 type">
                    <a href="#method_getView">getView</a>()
                                            <p>Get the view name</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_setOutput">setOutput</a>(
    string $str)
                                            <p>Set the output content</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_appendOutput">appendOutput</a>(
    string $content)
                                            <p>Append the output content to the existing content</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_prependOutput">prependOutput</a>(
    string $content)
                                            <p>Prepend the output content to the existing content</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    string
                </div>
                <div class="col-md-8 type">
                    <a href="#method_getOutput">getOutput</a>()
                                            <p>Get the current view rendering output</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_resetParams">resetParams</a>()
                                            <p>Reset the parameters for the current view on an empty array</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_setParams">setParams</a>(
    array $params)
                                            <p>Set an array of the parameters for the current view</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_addParam">addParam</a>(
    string $name, 
    mixed $val)
                                            <p>Add an entry of parameters for the current view</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    array
                </div>
                <div class="col-md-8 type">
                    <a href="#method_getParams">getParams</a>(
    bool $alone = false)
                                            <p>Get the parameters for the current view</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    mixed
                </div>
                <div class="col-md-8 type">
                    <a href="#method_getParam">getParam</a>(
    string $name, 
    mixed $default = null)
                                            <p>Get a value of the parameters for the current view</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    string
                </div>
                <div class="col-md-8 type">
                    <a href="#method_render">render</a>(
    string $view_file, 
    array $params = array())
                                            <p>Building of a view content including a view file passing it parameters</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    array
                </div>
                <div class="col-md-8 type">
                    <a href="#method_getDefaultViewParams">getDefaultViewParams</a>()
                                            <p>Get the default parameters for all views</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    string
                </div>
                <div class="col-md-8 type">
                    <a href="#method_getTemplate">getTemplate</a>(
    string $name)
                                            <p>Search a view file in the current file system</p>                </div>
                <div class="col-md-2"></div>
            </div>
            </div>


        <h2>Details</h2>

            <div id="method-details">
                    <div class="method-item">
                    <h3 id="method_setView">
        <div class="location">at line 50</div>
        <code>                    
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a>
    <strong>setView</strong>(
    string $path)</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Set the view name to parse</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
    string</td>
                <td>$path</td>
                <td>The name of the view to load</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a></td>
            <td>
</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_getView">
        <div class="location">at line 61</div>
        <code>                    
    string
    <strong>getView</strong>()</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Get the view name</p>                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    string</td>
            <td>The name of the view file to load</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_setOutput">
        <div class="location">at line 81</div>
        <code>                    
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a>
    <strong>setOutput</strong>(
    string $str)</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Set the output content</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
    string</td>
                <td>$str</td>
                <td>The output of a view parsing</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a></td>
            <td>
</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_appendOutput">
        <div class="location">at line 93</div>
        <code>                    
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a>
    <strong>appendOutput</strong>(
    string $content)</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Append the output content to the existing content</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
    string</td>
                <td>$content</td>
                <td>The output of a view parsing</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a></td>
            <td>
</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_prependOutput">
        <div class="location">at line 105</div>
        <code>                    
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a>
    <strong>prependOutput</strong>(
    string $content)</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Prepend the output content to the existing content</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
    string</td>
                <td>$content</td>
                <td>The output of a view parsing</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a></td>
            <td>
</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_getOutput">
        <div class="location">at line 116</div>
        <code>                    
    string
    <strong>getOutput</strong>()</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Get the current view rendering output</p>                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    string</td>
            <td>The rendering of the view</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_resetParams">
        <div class="location">at line 135</div>
        <code>                    
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a>
    <strong>resetParams</strong>()</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Reset the parameters for the current view on an empty array</p>                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a></td>
            <td>
</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_setParams">
        <div class="location">at line 147</div>
        <code>                    
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a>
    <strong>setParams</strong>(
    array $params)</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Set an array of the parameters for the current view</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
    array</td>
                <td>$params</td>
                <td>The array of parameters</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a></td>
            <td>
</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_addParam">
        <div class="location">at line 160</div>
        <code>                    
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a>
    <strong>addParam</strong>(
    string $name, 
    mixed $val)</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Add an entry of parameters for the current view</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
    string</td>
                <td>$name</td>
                <td>The name of the parameter</td>
            </tr>
                    <tr>
                <td>
    mixed</td>
                <td>$val</td>
                <td>The value to set for the parameter</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    <a href="../../Patterns/Traits/TemplateViewTrait.html"><abbr title="Patterns\Traits\TemplateViewTrait">TemplateViewTrait</abbr></a></td>
            <td>
</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_getParams">
        <div class="location">at line 172</div>
        <code>                    
    array
    <strong>getParams</strong>(
    bool $alone = false)</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Get the parameters for the current view</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
    bool</td>
                <td>$alone</td>
                <td>Get the stack of parameters without the default params (default is <code>false</code>)</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    array</td>
            <td>The array of parameters</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_getParam">
        <div class="location">at line 188</div>
        <code>                    
    mixed
    <strong>getParam</strong>(
    string $name, 
    mixed $default = null)</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Get a value of the parameters for the current view</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
    string</td>
                <td>$name</td>
                <td>The name of the parameter to get</td>
            </tr>
                    <tr>
                <td>
    mixed</td>
                <td>$default</td>
                <td>The default value returns if no parameter is defined for <code>$name</code></td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    mixed</td>
            <td>The parameter value if found, <code>$default</code> otherwise</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_render">
        <div class="location">at line 204</div>
        <code>    abstract                
    string
    <strong>render</strong>(
    string $view_file, 
    array $params = array())</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Building of a view content including a view file passing it parameters</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
    string</td>
                <td>$view_file</td>
                <td>The view filename (which must exist)</td>
            </tr>
                    <tr>
                <td>
    array</td>
                <td>$params</td>
                <td>An array of the parameters passed for the view parsing</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    string</td>
            <td>Returns the view file content rendering</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_getDefaultViewParams">
        <div class="location">at line 211</div>
        <code>    abstract                
    array
    <strong>getDefaultViewParams</strong>()</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Get the default parameters for all views</p>                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    array</td>
            <td>The array of default parameters</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_getTemplate">
        <div class="location">at line 219</div>
        <code>    abstract                
    string
    <strong>getTemplate</strong>(
    string $name)</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Search a view file in the current file system</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
    string</td>
                <td>$name</td>
                <td>The file path to search</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    string</td>
            <td>The path of the file found</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
            </div>

    
            </div>
                <div id="footer">
        Generated by <a href="http://sami.sensiolabs.org/">Sami, the API Documentation Generator</a>.
    </div>

        </div>
    </div>
    </body>

</html>