PHP Classes

File: code/includes/starter.php

Recommend this page to a friend!
  Classes of Junaid Hassan  >  PHP MVC  >  code/includes/starter.php  >  Download  
File: code/includes/starter.php
Role: Application script
Content type: text/plain
Description: starter.php
Class: PHP MVC
MVC framework that loads XML configuration files
Author: By
Last change:
Date: 4 years ago
Size: 1,992 bytes


Class file image Download

/* File name : starter.php
 * Created by : Junaid Hassan (email : , blog :
 * Created On : 14-April-2103
 * Description : It is trigger to start process for website.
 * Change Logs : 15-April -- add url class object to catalog
 * 16-April -- add database and other classes objects to catalog

//jha-- load configuration from config.xml and append some php configuration
$configuration = new Configuration();

//jha-- load classes and helper required by the applicaiton

//jha-- catalog is going to have all assets of the website and provide them in inherited controller
$catalog = new Catalog();
$catalog->set('configuration', $configuration);
$catalog->set('config', $configuration->config);

//jha-- create utilities object and assign to catalog
$utilities = new Utilities($catalog);
$catalog->set('utilities', $utilities);

//jha-- create utilities object and assign to catalog
$url = new Url($catalog);
$catalog->set('url', $url);

//jha-- parse url to find out controller and action, to route request to appropriate controller and action

//jha-- create loader object and assign to catalog
$loader = new Loader($catalog);
$catalog->set('loader', $loader);

//jha-- create database object and assign to catalog
$database = new Database($catalog);
$catalog->set('database', $database);

//jha-- create object of required controller and assign catalog
$obj = new $url->controller_class($catalog);

if (
    if (
count($url->qParams) > 0)
$parms = $url->qParams;
$parms = array();
$parms = array();

//jha-- call appropriate method from appropriate class by appropriate passing parameters
call_user_func_array(array($obj, $url->controller_action), $parms);