diff --git a/application/config.php b/application/config.php index f2ba052..d59ed30 100644 --- a/application/config.php +++ b/application/config.php @@ -43,7 +43,7 @@ return [ // 是否开启多语言 'lang_switch_on' => false, // 默认全局过滤方法 用逗号分隔多个 - 'default_filter' => 'htmlspe', + 'default_filter' => 'htmlspecialchars', // 默认语言 'default_lang' => 'zh-cn', // 应用类库后缀 diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php index 56eddf2..debde4d 100644 --- a/application/index/controller/Index.php +++ b/application/index/controller/Index.php @@ -31,6 +31,16 @@ class Index extends Base public function tree() { + $arr = []; + $arr1 = []; + $arr2 = []; + $arr3 = ['king'=>'best']; + //$arr = array_merge($arr1, $arr2, $arr3); + var_dump($arr); + } + public function hello() + { + var_dump(input()); } } diff --git a/application/index/controller/News.php b/application/index/controller/News.php new file mode 100644 index 0000000..5e75e30 --- /dev/null +++ b/application/index/controller/News.php @@ -0,0 +1,40 @@ +request->ext(), false) . "' method='post'> + + + + + "; + echo $html; + $arr = $this->request->param(); + var_dump($id); + var_dump($arr); + } + + public function update() + { + if ($_SERVER['REQUEST_METHOD'] == 'POST') { + var_dump($_REQUEST); + die; + } else { + echo '无效的请求'; + } + } +} \ No newline at end of file diff --git a/application/route.php b/application/route.php index f648d3b..4ebbb9d 100644 --- a/application/route.php +++ b/application/route.php @@ -8,14 +8,27 @@ // +---------------------------------------------------------------------- // | Author: liu21st // +---------------------------------------------------------------------- +use think\Route; + + +//Route::rule(['new','new/:id'],'index/News/read'); +//Route::rule('/new/:k', 'index/News/read/','GET'); +//Route::rule('/new/:k', 'index/News/update/','POST'); return [ + 'new/:id' => [ + //'News/read?status=1&app_id=5', + 'News/read', + ['method' => 'get|post','ext' => 'shtml'], + ['id' => '\w+'], + ], '__pattern__' => [ 'name' => '\w+', ], - '[hello]' => [ - ':id' => ['index/hello', ['method' => 'get'], ['id' => '\d+']], + '[hello]' => [ + ':id' => ['index/hello', ['method' => 'get'], ['id' => '\d+']], ':name' => ['index/hello', ['method' => 'post']], ], ]; +