#1 prince
目录结构/ -> 根目录
/client/index.php ->放在二级目录
/client/speedphp ->sp目录
/client/conctroller ->控制器目录
/client/model ->模块目录
/client/tmp ->编译、缓存目录
以下为index.php内容:
header("content-type:text/html; charset=utf8");以下为/client/conctroller/main.php内容:
define("SP_PATH",dirname(__FILE__)."/SpeedPHP");
define("APP_PATH",dirname(__FILE__));
$spConfig = array(
'db' => array(
'driver' => 'mysql',
'host' => 'localhost',
'login' => 'root',
'password' => '123321',
'database' => 'xinshike',
),
'view' => array(
'enabled' => TRUE, // 开启Smarty
'config' =>array(
'template_dir' => APP_PATH.'/tpl', // 模板存放的目录
'compile_dir' => APP_PATH.'/tmp', // 编译的临时目录
'cache_dir' => APP_PATH.'/tmp', // 缓存的临时目录
'left_delimiter' => '<{', // smarty左限定符
'right_delimiter' => '}>', // smarty右限
),
),
);
require(SP_PATH."/SpeedPHP.php");
spRun();
header("content-type:text/html; charset=utf8");以下为/client/tpl/main_index.html内容:
class main extends spController{
function index(){
$this -> display("main_index.html");
}
function client_top(){
$this -> display("client_top.html");
}
function main_left(){
$this -> display("main_left.html");
}
function right(){
$this -> display("right.html");
}
function login(){
$this -> display("login.html");
}
地址栏中访问:localhost/client为空白,查看源码显示为:后台管理系统
尝试了把后台管理系统
function index(){改为:
$this -> display("main_index.html");
}
function index(){后又能显示right.html的内容,请高手帮忙看看是哪里出错了!
$this -> display("right.html");
}
2010-07-07 16:59:14