File: examples/frontcontroller/index.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil  >  PHP Skeleton Framework  >  examples/frontcontroller/index.php  >  Download  
File: examples/frontcontroller/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: 5 years ago
Size: 1,270 bytes


Class file image Download
dirname(__FILE__) . '/../../A/Locator.php';


// create Registry/Loader and initialize autoloading
$Locator = new A_Locator();

$Response = new A_Http_Response();
$Locator->set('Request', new A_Http_Request());
$Locator->set('Response', $Response);

$DefaultAction = array('', 'home', 'index');
$ErrorAction = 'error';

$Mapper = new A_Controller_Mapper('', $DefaultAction);
#$Mapper->setParams('action', ''); // add this line to run 0.3.x code
#$Mapper->setDefaultMethod('execute'); // add this line to run 0.4.x and 0.3.x code
#$Mapper->setDefaultMethod('run'); // add this line to run 0.7.x code
#$Mapper->setDefaultDir('default'); // add this for a default module directory

$Controller = new A_Controller_Front($Mapper, $ErrorAction);
#$Controller = new A_Controller_Front('', $ErrorAction, $DefaultAction); // have FC create Mapper


if (
$Controller->isError()) {
'<br/><br/>Front Controller errors: ' . $Controller->getErrorMsg();

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