PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Md. Shahadat Hossain Khan Razon  >  Template Engine Using Zend PHP Renderer  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: Template Engine Using Zend PHP Renderer
Template engine based on Zend Framework renderer
Author: By
Last change:
Date: 7 years ago
Size: 1,218 bytes
 

Contents

Class file image Download
<?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');