亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

模型驗證器-控制器

原創(chuàng) 2019-04-06 13:45:39 180
摘要:namespace app\admin\controller;use think\Controller;class Category extends Controller{   public function index ()   {      //判斷post請求      if ( request ()-&

namespace app\admin\controller;use think\Controller;class Category extends Controller{   public function index ()   {      //判斷post請求      if ( request ()->isPost () ) {         //實例化Category模型         //模型返回的數(shù)據(jù)['code'=>1,'msg'=>'操作成功']         //input ('post.')接受post提交數(shù)據(jù)         $model = ( new \app\common\model\Category() )->store (input ('post.'));         if ( $model[ 'code' ] ) {            return $this->success ( $model[ 'msg' ] , 'index' );         } else {            return $this->error ( $model[ 'msg' ] );         }      }      //渲染模板      return view ();   }}

批改老師:天蓬老師批改時間:2019-04-08 09:53:32
老師總結(jié):你的作業(yè)提交也太不走心了, 請問這樣的代碼, 你讓我怎么看? namespace app\admin\controller;use think\Controller;class Category extends Controller{ public function index () { //判斷post請求 if ( request ()->isPost ()

發(fā)佈手記

熱門詞條