命名规范调整

This commit is contained in:
thinkphp
2013-03-14 09:40:43 +08:00
parent 7b1541e1f8
commit b96c650a1e
3 changed files with 4 additions and 7 deletions

View File

@@ -51,12 +51,12 @@ class App {
self::dispatch($config); self::dispatch($config);
// 执行操作 // 执行操作
$instance = Loader::controller(CONTROLL_NAME); $instance = Loader::controller(CONTROLLER_NAME);
if(!$instance) { if(!$instance) {
// 是否定义empty控制器 // 是否定义empty控制器
$instance = Loader::controller('empty'); $instance = Loader::controller('empty');
if(!$instance){ if(!$instance){
_404('controller not exists :'.CONTROLL_NAME); _404('controller not exists :'.CONTROLLER_NAME);
} }
} }
@@ -267,7 +267,7 @@ class App {
} }
// 获取控制器名 // 获取控制器名
define('CONTROLLER_NAME', strtolower(isset($_GET[$var_controll])?$_GET[$var_controll]:$config['default_controll'])); define('CONTROLLER_NAME', strtolower(isset($_GET[$var_controll])?$_GET[$var_controll]:$config['default_controller']));
// 获取操作名 // 获取操作名
define('ACTION_NAME', strtolower(isset($_GET[$var_action])?$_GET[$var_action]:$config['default_action'])); define('ACTION_NAME', strtolower(isset($_GET[$var_action])?$_GET[$var_action]:$config['default_action']));

View File

@@ -92,7 +92,7 @@ class Url {
$var = array(); $var = array();
$var[Config::get('var_action')] = !empty($path)?array_pop($path):ACTION_NAME; $var[Config::get('var_action')] = !empty($path)?array_pop($path):ACTION_NAME;
if(Config::get('require_controller')) { if(Config::get('require_controller')) {
$var[Config::get('var_controller')] = !empty($path)?array_pop($path):CONTROLL_NAME; $var[Config::get('var_controller')] = !empty($path)?array_pop($path):CONTROLLER_NAME;
} }
if(Config::get('require_module')) { if(Config::get('require_module')) {
$var[Config::get('var_module')] = !empty($path)?array_pop($path):MODULE_NAME; $var[Config::get('var_module')] = !empty($path)?array_pop($path):MODULE_NAME;

View File

@@ -27,9 +27,6 @@ return [
'default_action' => 'index', // 默认操作名 'default_action' => 'index', // 默认操作名
'default_layer' => 'action', // 默认控制器层 'default_layer' => 'action', // 默认控制器层
'action_suffix' => '', // 操作方法后缀 'action_suffix' => '', // 操作方法后缀
'module_name' => '', // 当前模块名
'controll_name' => '', // 当前控制器名
'action_name' => '', // 当前操作名
'file_ext' => '.php', // 文件后缀 'file_ext' => '.php', // 文件后缀
'url_model' => 1, // URL模式 'url_model' => 1, // URL模式
'base_url' => $_SERVER["SCRIPT_NAME"], // 基础URL路径 'base_url' => $_SERVER["SCRIPT_NAME"], // 基础URL路径