惯例配置
应用设置
'app_debug' => true,
'app_status' => '',
'app_trace' => false,
'app_multi_module' => true,
'root_namespace' => [],
'extra_config_list' => ['database', 'route', 'validate'],
'extra_file_list' => [THINK_PATH . 'helper' . EXT],
'default_return_type' => 'html',
'default_ajax_return' => 'json',
'default_jsonp_handler' => 'jsonpReturn',
'var_jsonp_handler' => 'callback',
'default_timezone' => 'PRC',
'lang_switch_on' => false,
'default_filter' => '',
'default_lang' => 'zh-cn',
'class_suffix' => false,
'controller_suffix' => false,
模块设置
'default_module' => 'index',
'deny_module_list' => ['common'],
'default_controller' => 'Index',
'default_action' => 'index',
'default_validate' => '',
'empty_controller' => 'Error',
'action_suffix' => '',
'controller_auto_search' => false,
URL设置
'var_pathinfo' => 's',
'pathinfo_fetch' => ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL'],
'pathinfo_depr' => '/',
'url_html_suffix' => 'html',
'url_common_param' => false,
'url_param_type' => 0,
'url_route_on' => true,
'url_route_must' => false,
'url_domain_deploy' => false,
'url_domain_root' => '',
'url_convert' => true,
'url_controller_layer' => 'controller',
'var_method' => '_method',
'var_ajax' => '_ajax',
'var_pjax' => '_pjax',
'request_cache' => false,
'request_cache_expire' => null,
模板引擎设置
'template' => [
'type' => 'Think',
'view_path' => '',
'view_suffix' => 'html',
'view_depr' => DS,
'tpl_begin' => '{',
'tpl_end' => '}',
'taglib_begin' => '{',
'taglib_end' => '}',
],
'view_replace_str' => [],
'dispatch_success_tmpl' => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl',
'dispatch_error_tmpl' => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl',
异常及错误设置
'exception_tmpl' => THINK_PATH . 'tpl' . DS . 'think_exception.tpl',
'error_message' => '页面错误!请稍后再试~',
'show_error_msg' => false,
日志设置
'log' => [
'type' => 'File',
'path' => LOG_PATH,
],
Trace设置
'trace' => [
'type' => 'Html',
],
缓存设置
'cache' => [
'type' => 'File',
'path' => CACHE_PATH,
'prefix' => '',
'expire' => 0,
],
会话设置
'session' => [
'id' => '',
'var_session_id' => '',
'prefix' => 'think',
'type' => '',
'auto_start' => true,
],
Cookie设置
'cookie' => [
'prefix' => '',
'expire' => 0,
'path' => '/',
'domain' => '',
'secure' => false,
'httponly' => '',
'setcookie' => true,
],
数据库设置
'database' => [
'type' => 'mysql',
'dsn' => '',
'hostname' => 'localhost',
'database' => '',
'username' => 'root',
'password' => '',
'hostport' => '',
'params' => [],
'charset' => 'utf8',
'prefix' => '',
'debug' => false,
'deploy' => 0,
'rw_separate' => false,
'master_num' => 1,
'slave_no' => '',
'fields_strict' => true,
'resultset_type' => 'array',
'auto_timestamp' => false,
'sql_explain' => false,
],
分页配置
'paginate' => [
'type' => 'bootstrap',
'var_page' => 'page',
'list_rows' => 15,
],