File: src/View.php

Recommend this page to a friend!
  Classes of Thierry Feuzeu  >  Jaxon for Zend Framework  >  src/View.php  >  Download  
File: src/View.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Jaxon for Zend Framework
Zend plugin to call PHP classes from with AJAX
Author: By
Last change: Apply fixes from StyleCI
Date: 3 years ago
Size: 1,249 bytes
 

Contents

Class file image Download
<?php

namespace Jaxon\Zend;

use
Zend\View\Renderer\RendererInterface;
use
Zend\View\Model\ViewModel;

use
Jaxon\Sentry\View\Store;
use
Jaxon\Sentry\Interfaces\View as ViewInterface;

class
View implements ViewInterface
{
    protected
$renderer;

    public function
__construct(RendererInterface $renderer)
    {
       
$this->renderer = $renderer;
    }

   
/**
     * Add a namespace to this view renderer
     *
     * @param string $sNamespace The namespace name
     * @param string $sDirectory The namespace directory
     * @param string $sExtension The extension to append to template names
     *
     * @return void
     */
   
public function addNamespace($sNamespace, $sDirectory, $sExtension = '')
    {}

   
/**
     * Render a view
     *
     * @param Store $store A store populated with the view data
     *
     * @return string The string representation of the view
     */
   
public function render(Store $store)
    {
       
// Render the view
       
$view = new ViewModel($store->getViewData());
       
$view->setTemplate($store->getViewName());
       
$view->setTerminal(true);
        return
trim($this->renderer->render($view), " \t\n");
    }
}


For more information send a message to info at phpclasses dot org.