PHP Classes

File: BootStrap

Recommend this page to a friend!
  Classes of Steve Winnington   Autoloader with MVC in mind   BootStrap   Download  
File: BootStrap
Role: Example script
Content type: text/plain
Description: Example of BootStrap for Class
Class: Autoloader with MVC in mind
Autoload classes from common directories
Author: By
Last change:
Date: 10 years ago
Size: 1,001 bytes


Class file image Download

define('ROOT', dirname(__FILE__));

/// MVC FOLDERS ////
My Example Structure



define('CONTROL_CUSTOM', ROOT.DS.'lib'.DS.'control_custom'.DS );
define('CONTROL', ROOT.DS.'lib'.DS.'control'.DS );
define('MODEL_DAO', ROOT.DS.'lib'.DS.'model'.DS.'dao'.DS );
define('MODEL_VO', ROOT.DS.'lib'.DS.'model'.DS.'vo'.DS );
define('MODEL_FORMS', ROOT.DS.'lib'.DS.'model'.DS.'forms'.DS );
define('VIEW', ROOT.DS.'lib'.DS.'view'.DS );
define('VIEW_CUSTOM', ROOT.DS.'lib'.DS.'view_custom'.DS );

///////AUTO LOADING CLASSES////////////


Now you should be able to load any class automatically and get the accociated view.

I keep my core files in the control and view folders and any custom modifications from standard go into the _custom folders which are not updated.