PHP Classes

File: examples/view/index.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   examples/view/index.php   Download  
File: examples/view/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Skeleton Framework
Extensive Web application development framework
Author: By
Last change:
Date: 8 years ago
Size: 1,666 bytes
 

Contents

Class file image Download
<?php
/* error settings */
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 1);
ini_set('log_errors', 'Off');

include
'config.php';
include
dirname(__FILE__) . '/../../A/Locator.php';

$Locator = new A_Locator();
$Locator->autoload();

$Request = new A_Http_Request();
$Response = new A_Http_Response();
$Locator->set('Request', $Request);
$Locator->set('Response', $Response);
 
$DefaultAction = array('', 'example', 'index');
$ErrorAction = array('', 'error', 'index');
$Mapper = new A_Controller_Mapper($ConfigArray['APP'], $DefaultAction);

$Controller = new A_Controller_Front($Mapper, $ErrorAction);
$Controller->run($Locator);

//$Controller->addPreMethod(array('', 'signin', 'index'));
//$Controller->run($Locator);
 
/*
if (! $Response->hasRenderer()) {
    // create a page renderer and load the outer layout page template
    $Template = new A_Template_Strreplace($ConfigArray['APP'] . 'templates/main.html');
    $Response->setRenderer($Template);
  
    // get the layout specified by the Action
    $Layout_name = $Response->get('layout');
    if (! $Layout_name) {
        $Layout_name = 'standardlayout'; // or use the default
    }
    // load the layout for just the content area
    $Layout = new A_Template_Strreplace($ConfigArray['APP'] . 'templates/layout/' . $Layout_name . '.php');
    // set the two possible columns
    $Layout->set('maincontent', $Response->get('maincontent'));
    $Layout->set('rightcol', $Response->get('rightcol'));
    // render the sub-layout as the content area of the main outer layout
    $Response->set('content', $Layout->render());

}
// send response
echo $Response->render();
*/