PHP Classes
elePHPant
Icontem

File: src/Utils/Traits/View.php

Recommend this page to a friend!
  Classes of Thierry Feuzeu  >  Jaxon  >  src/Utils/Traits/View.php  >  Download  
File: src/Utils/Traits/View.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Jaxon
Call PHP classes from JavaScript using AJAX
Author: By
Last change: Merge pull request #39 from jaxon-php/v2.2.x

Merge from v2.2.5
Date: 5 months ago
Size: 1,848 bytes
 

 

Contents

Class file image Download
<?php

/**
 * View.php - Trait for view functions
 *
 * @package jaxon-core
 * @author Thierry Feuzeu <thierry.feuzeu@gmail.com>
 * @copyright 2016 Thierry Feuzeu <thierry.feuzeu@gmail.com>
 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
 * @link https://github.com/jaxon-php/jaxon-core
 */

namespace Jaxon\Utils\Traits;

use
Jaxon\DI\Container;

trait
View
{
   
/**
     * Set the view renderers data
     *
     * @param array $aRenderers Array of renderer names with namespace as key
     *
     * @return void
     */
   
public function initViewRenderers($aRenderers)
    {
        return
Container::getInstance()->initViewRenderers($aRenderers);
    }
   
   
/**
     * Set the view namespaces data
     *
     * @param array $aNamespaces Array of namespaces with renderer name as key
     *
     * @return void
     */
   
public function initViewNamespaces($aNamespaces, $sDefaultNamespace)
    {
        return
Container::getInstance()->initViewNamespaces($aNamespaces, $sDefaultNamespace);
    }
   
   
/**
     * Get the view renderer facade
     *
     * @param string $sId The unique identifier of the view renderer
     *
     * @return object The view renderer
     */
   
public function getViewRenderer($sId = '')
    {
        return
Container::getInstance()->getViewRenderer($sId);
    }
   
   
/**
     * Add a view renderer with an id
     *
     * @param string $sId The unique identifier of the view renderer
     * @param Closure $xClosure A closure to create the view instance
     *
     * @return void
     */
   
public function addViewRenderer($sId, $xClosure)
    {
       
Container::getInstance()->addViewRenderer($sId, $xClosure);
    }
}