🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
``` __STATIC__ <!--包含头部文件--> {include file="public/header" /} <!--包含footer文件--> {include file="public/footer" /} 输出控制器:echo request()->controller(); $request = Request::instance(); echo "当前模块名称是" . $request->module(); echo "当前控制器名称是" . $request->controller(); echo "当前操作名称是" . $request->action(); session(null, 'user'); // 跳出 return $this->redirect(url('login/index')); // allowField 过滤data数组中非数据表中的数据 return $this->allowField(true)->save($data, ['id'=>$id]); <{volist name="category" id="vo"}>   <a class="nav-a" href="#" ><li class=""><{$vo.catname}></li></a> <{/volist}> -------------------------------------------------------------------------------- //跳转页面 onclick="loadtea()" function loadtea(){   url="<{:url('all')}>"; } // 模板变量赋值 $this->assign('name','ThinkPHP'); return $this->fetch('index'); return view(); ----------------------------------------------------------------------- ``` ``` if($result){   $stu = new Classcourse_Model();   $cnt = $stu->allowField(true)->save($data);   if($cnt){     $arr = ['success'=>true,'msg'=>'添加成功'];   }else{     $arr = ['success'=>false,'msg'=>'添加失败'];   } }else{   $arr = ['success'=>false,'msg'=>$result]; } return json_encode($arr); ``` ``` if($result){   $stu = new Classcourse_Model();   $cnt = $stu->allowField(true)->save($data);   if($cnt){     $arr = ['success'=>true,'msg'=>'添加成功'];   }else{     $arr = ['success'=>false,'msg'=>'添加失败'];   } }else{   $arr = ['success'=>false,'msg'=>$result]; } return json_encode($arr); ``` ``` <input type="text" name="captcha" placeholder="请输入验证码" required=""><br> <img src="<{:captcha_src()}>" width="95" height="45" onclick="this.src='<{:captcha_src()}>'"><br><br> $captcha = $_REQUEST['captcha']; if(!captcha_check($captcha)){   //验证失败   $this->error('验证码输入错误'); }else{   $this->success('成功',url('user/login')); } ``` ``` ```