入口文件 ,十分的简陋啊现在看来。。
FRAMWORK是四个基本文件的存储文件夹
<?php
$p=!empty($_GET['p'])? $_GET['p'] : 'front';
define("PLAT",$p);
define("DS",DIRECTORY_SEPARATOR);
define("ROOT",__DIR__.DS);
define("APP",ROOT."APPLICATION".DS);
define("FRAMWORK",ROOT."FRAMWORK".DS);
define("PLAT_PATH",APP.PLAT.DS);
define("CTRL_PATH",PLAT_PATH."CONTROLLERS".DS);
define("MODEL_PATH",PLAT_PATH."MODELS".DS);
define("VIEW_PATH",PLAT_PATH."VIEWS".DS);
function __autoload($class){
$arr=array('BaseModel','BaseController','SqlTool','ModelFactory');
if(in_array($class,$arr)){
require FRAMWORK.$class.'.class.php';
}
else if(substr($class,-5)=='Model'){
require MODEL_PATH.$class.'.class.php';
}
else if(substr($class,-10)=='Controller'){
require CTRL_PATH.$class.'.class.php';
}
}
$c=!empty($_GET['c'])? $_GET['c'] : 'User';
$ctrl_name = $c."Controller";
$ctrl =new $ctrl_name();
$a=!empty($_GET['a'])? $_GET['a'] : 'Index';
$action = $a.'Action';
$ctrl->$action();
?>