thinkphp第一天
记录要点:
1、入口文件index.php
define('APP_NAME',应用名称);
define('APP_PATH','./应用路径/');
define('APP_DEBUG',true);开启调试模式,便于显示错误信息
requrie './ThinkPHP/ThinkPHP.php';
2、配置文件conf中的config.php
return array(
'配置项'=>'配置内容', //配置项用大写字母 读取配置项实用 C 函数
);
3、每个模块都创建一个控制器Action,默认的控制器为Index模块,控制器命名规则为模块名+Action.class.php,即驼峰命名法加首字母大写。如UserAction.class.php
4、视图文件在tpl文件夹中,每个控制器对应一个文件夹如UserAction.class.php对应的视图文件应该是在tpl/User/中,每个方法对应一个视图文件。Tpl/模块名/操作名.html