在项目文件夹内创建入口文件index.php
define('THINK_PATH', '../ThinkPHP');
define('APP_PATH', '.');
require(THINK_PATH."/ThinkPHP.php");
App::run();
?>
在浏览器中访问入口地址http://yourdomain/项目文件夹/index.php,之后ThinkPHP会自动生成项目文件.
在项目文件夹下Lib/Action目录中,会生成默认的控制器文件IndexAction.php,你可以直接修改使用它.
/**** IndexAction ****/
class IndexAction extends Action{
public function yourfunctionname(){
echo '默认操作
';
}
public function yourfunctionname(){
$this -> redirect('target',array('参数名1'=>参数值1,'参数名2'=>参数值2,.......),跳转前停滞时间n秒,'跳转前的提示:n秒后跳转到target'); //重定向,即ThinkPHP自带的跳转函数
}
public tunction target(){
echo '跳转成功,这里就是target.
';
echo '参数名1:'.$_GET['参数名1'].'
';
echo '参数名2:'.$_GET['参数名2'].'
';
}
}
?>
然后在浏览器中访问你yourfunctionname的地址:
http://yourdomain/项目文件夹/index.php?Index/yourfunctionname,
就可以调用你自定义的函数了,系统会在n秒后跳转到target,并显示输出.
extend.php是一个扩展函数库,可以拷贝到控制器文件(如IndexAction)中使用
功能包括
楼主还有什么不懂的就去后盾人那里多学习学习