06 2017 档案

摘要:find( ' get.goods_id ' ); if($goods_info){//若获取该条信息成功 //调用history()方法 $this->history($goods_info); //var_dump(session('history')); } $this->assign( ' mbx ' , $this... 阅读全文
posted @ 2017-06-30 21:41 SYsunyi 阅读(402) 评论(0) 推荐(0)
摘要:属性1=值1 * 2、批量赋值$model->create($arr); * 3、直接create() * create 将自动分析POST数据,并进行赋值到model的数据对象上 * 再调用add(),save()就可以执行添加或者修改 */ /** * 自动验证 * 再TP中,再model中写验证规则,即$_validata属性 * 定义好验证规则后,就可以在使用creat... 阅读全文
posted @ 2017-06-29 17:08 SYsunyi 阅读(156) 评论(0) 推荐(0)
摘要:find($cat_id); $tree[] = $row;//将该条数据放入数组中 while($row['parent_id']>0){//只要该条数据的parent_id>0 $row = D('cat_id')->fine($row['parent_id']); $tree[] = $row; } //array_rever... 阅读全文
posted @ 2017-06-29 16:41 SYsunyi 阅读(2616) 评论(0) 推荐(0)
摘要:check($yzm)){//调用check方法 return true; }else{ echo '验证码错误'; exit(); } } public function login(){ if(!IS_POST){ $this->display(); }else{ //若验证码验... 阅读全文
posted @ 2017-06-29 16:40 SYsunyi 阅读(541) 评论(0) 推荐(0)
摘要:/** * M层 * (3) 验证提交数据的合法性 * 3.1 Model层声明验证方式 */ class UserModel extends Model{ public $_validate = array( //array(验证字段,验证规则,错误提示,【验证条件,附加条件,验证时间】) array('username' , '3,10' ... 阅读全文
posted @ 2017-06-29 16:38 SYsunyi 阅读(422) 评论(0) 推荐(0)
摘要:display(); }else{ //var_dump($_POST); $catModel=D('cat'); //添加post过来的数据 $catModel->add($_POST); } } /** * 栏目列表 * C层获取所有数据 */ public function catelist(){ ... 阅读全文
posted @ 2017-06-29 16:30 SYsunyi 阅读(255) 评论(0) 推荐(0)