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

模型驗(yàn)證器-控制器

original 2019-04-06 13:45:39 180
abstrait:namespace app\admin\controller;use think\Controller;class Category extends Controller{   public function index ()   {      //判斷post請(qǐng)求      if ( request ()-&

namespace app\admin\controller;use think\Controller;class Category extends Controller{   public function index ()   {      //判斷post請(qǐng)求      if ( request ()->isPost () ) {         //實(shí)例化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 ();   }}

Professeur correcteur:天蓬老師Temps de correction:2019-04-08 09:53:32
Résumé du professeur:你的作業(yè)提交也太不走心了, 請(qǐng)問(wèn)這樣的代碼, 你讓我怎么看? namespace app\admin\controller;use think\Controller;class Category extends Controller{ public function index () { //判斷post請(qǐng)求 if ( request ()->isPost ()

Notes de version

Entrées populaires