PHP Classes

Template Engine Using Zend PHP Renderer: Template engine based on Zend Framework renderer

Recommend this page to a friend!
  Info   Example   Demos   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 84 All time: 10,045 This week: 74Up
Version License PHP version Categories
renderer 1.0GNU General Publi...5.3PHP 5, Templates
Description 

Author

This class is a template engine based on Zend Framework renderer.

It can take a template script and use Zend rendered to process it without fully load the whole framework thus bypassing Zend bootstrapping.

The class can be used to render either static pages or dynamic template based pages.

Picture of Md. Shahadat Hossain Khan Razon
  Performance   Level  
Name: Md. Shahadat Hossain ... <contact>
Classes: 14 packages by
Country: Bangladesh Bangladesh
Age: 43
All time rank: 2986 in Bangladesh Bangladesh
Week rank: 21 Up1 in Bangladesh Bangladesh Up

Example

<?php

use TemplateEngineUsingZend\Renderer;
use
Zend\Mvc\Application;
error_reporting(E_ALL);
ini_set("display_errors", 1);

define('REQUEST_MICROTIME', microtime(true));

if(!
defined('DS')) define('DS', DIRECTORY_SEPARATOR);
/**
 * This makes our life easier when dealing with paths. Everything is relative
 * to the application root now.
*/
chdir(dirname(__DIR__).DS.'..'.DS.'AppByZend');

// Decline static file requests back to the PHP built-in webserver
if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) {
    return
false;
}

// Setup autoloading
#die(getcwd());
require 'init_autoloader.php';

$tpl=new Renderer(Application::init(require 'config/application.config.php'), __DIR__ . DS.'layout.phtml');
/**
 * you need to specify where i found store i.e. store location
 * this is a relative path, from this location from where the script running or loading
 * from the http root or current script
 */
$tpl->setBasePath('../');
echo
$tpl(__DIR__ . DS.'shahadat.phtml', array('ownerName' => 'shahadat hossain khan'));
#$tpl->setVariable('ownerName', 'shahadat hossain khan');
#echo $tpl(__DIR__ . DS.'shahadat.phtml');



  BPE Shopping CartExternal page  
  Files folder image Files (4)  
File Role Description
Files folder imageTemplateEngineUsingZend (1 file)
Accessible without login Plain text file example.php Example Example
Accessible without login Plain text file layout.phtml Aux. Layout
Accessible without login Plain text file shahadat.phtml Example Template Script

  Files folder image Files (4)  /  TemplateEngineUsingZend  
File Role Description
  Plain text file Renderer.php Class Core Class File

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:84
This week:0
All time:10,045
This week:74Up