File: examples/basic_app/index.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil  >  PHP Skeleton Framework  >  examples/basic_app/index.php  >  Download  
File: examples/basic_app/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,743 bytes


Class file image Download
require_once 'config.php';
$ConfigArray['LIB'] . 'A/Locator.php';

#require_once 'A/DataContainer.php';
#require_once 'A/Session.php';
#require_once 'A/Locator.php';
#require_once 'A/Http/Request.php';
#require_once 'A/Http/Response.php';
#require_once 'A/Http/Pathinfo.php';
#require_once 'A/Controller/Front.php';
#require_once 'A/Controller/Mapper.php';
#require_once 'A/Template/Strreplace.php';

$Locator = new A_Locator();
$Locator->autoload(); // initialize autoloading

$Request = new A_Http_Request();
$Response = new A_Http_Response();
$Session = new A_Session();

$Locator->set('Config', new A_Collection($ConfigArray));
$Locator->set('Request', $Request);
$Locator->set('Response', $Response);
$Locator->set('Session', $Session);

$Mapper = new A_Http_Pathinfo(array('' => array('controller','action','id',))); // array('' => array('class', 'method')));
$Mapper->run($Request); // copies clean URL values into the Request based on the map

$Action = array('', 'home', 'index');
$Mapper = new A_Controller_Mapper($ConfigArray['APP'], $Action); // action controllers in default 'controller' directory
#$Mapper->setDefaultMethod('execute'); // uncomment to make compatable with pre 0.4.x

$Controller = new A_Controller_Front($Mapper, $Action);

if (!
$Response->hasRenderer()) {
$Template = new A_Template_Strreplace($ConfigArray['APP'] . 'templates/main.html');
$Template->set('title', '');
$Template->set('head', '');
$Template->set('content', '');
$Template->set('sidebar', '');

$Response->set('BASE', $ConfigArray['BASE']); // this renders in all templates
echo $Response->render();

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