当前位置: 首页>>代码示例>>PHP>>正文


PHP Filter::form方法代码示例

本文整理汇总了PHP中Filter::form方法的典型用法代码示例。如果您正苦于以下问题:PHP Filter::form方法的具体用法?PHP Filter::form怎么用?PHP Filter::form使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Filter的用法示例。


在下文中一共展示了Filter::form方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: help_save

 function help_save()
 {
     $rules = array('title:required:标题不能为空!', 'content:required:内容不能为空!');
     $info = Validator::check($rules);
     if ($info == true) {
         Filter::form(array('sql' => 'title', 'text' => 'content'));
         if (Req::args('id') == null) {
             Req::args('publish_time', date('Y-m-d H:i:s'));
         }
         $id = Req::args('id');
         $model = new Model("help");
         if ($id) {
             $model->where("id={$id}")->update();
             Log::op($this->manager['id'], "修改帮助", "管理员[" . $this->manager['name'] . "]:修改了帮助 " . Req::args('title'));
         } else {
             $model->insert();
             Log::op($this->manager['id'], "添加帮助", "管理员[" . $this->manager['name'] . "]:添加了帮助 " . Req::args('title'));
         }
     } else {
         if (is_array($info)) {
             $data = Req::args() + array('validator' => $info);
             $this->redirect('help_edit', false, $data);
             exit;
         }
     }
     $this->redirect("help_list");
 }
开发者ID:sammychan1981,项目名称:quanpin,代码行数:27,代码来源:content.php

示例2: ask_validator

 function ask_validator()
 {
     $manager = $this->safebox->get('manager');
     $rules = array('content:required:内容不能为空!');
     $info = Validator::check($rules);
     if ($info == true) {
         Filter::form(array('text' => 'content'));
         if (Req::args('id') != null) {
             Req::args('reply_time', date('Y-m-d H:i:s'));
             Req::args('status', 1);
             Req::args('admin_id', $manager['id']);
         }
     }
     return $info;
 }
开发者ID:sammychan1981,项目名称:quanpin,代码行数:15,代码来源:customer.php

示例3: address_save

 public function address_save($redirect = null)
 {
     $rules = array('zip:zip:邮政编码格式不正确!', 'addr:required:内容不能为空!', 'accept_name:required:收货人姓名不能为空!,mobile:mobi:手机格式不正确!,phone:phone:电话格式不正确', 'province:[1-9]\\d*:选择地区必需完成', 'city:[1-9]\\d*:选择地区必需完成', 'county:[1-9]\\d*:选择地区必需完成');
     $info = Validator::check($rules);
     if (!is_array($info) && $info == true) {
         Filter::form(array('sql' => 'accept_name|mobile|phone', 'txt' => 'addr', 'int' => 'province|city|county|zip|is_default|id'));
         $is_default = Filter::int(Req::args("is_default"));
         if ($is_default == 1) {
             $this->model->table("address")->where("user_id=" . $this->user['id'])->data(array('is_default' => 0))->update();
         } else {
             Req::args("is_default", "0");
         }
         Req::args("user_id", $this->user['id']);
         $id = Filter::int(Req::args('id'));
         if ($id) {
             $this->model->table("address")->where("id={$id} and user_id=" . $this->user['id'])->update();
         } else {
             $obj = $this->model->table("address")->where('user_id=' . $this->user['id'])->fields("count(*) as total")->find();
             if ($obj && $obj['total'] >= 20) {
                 $this->assign("msg", array("error", '地址最大允许添加20个'));
                 $this->redirect("address_other", false, Req::args());
                 exit;
             } else {
                 $address_id = $this->model->table("address")->insert();
                 $order_status = Session::get("order_status");
                 $order_status['address_id'] = $address_id;
                 Session::set("order_status", $order_status);
             }
         }
         $this->assign("msg", array("success", "地址编辑成功!"));
         Req::args("id", null);
         //$this->redirect("address_other",false);
         if ($redirect == null) {
             echo "<script>parent.location.reload();</script>";
         } else {
             $this->redirect($redirect);
         }
         exit;
     } else {
         $this->assign("msg", array("error", $info['msg']));
         $this->redirect("address_other", false, Req::args());
     }
 }
开发者ID:sammychan1981,项目名称:quanpin,代码行数:43,代码来源:simple.php

示例4: voucher_activated

 public function voucher_activated()
 {
     if (!Tiny::app()->checkToken()) {
         $this->redirect("voucher");
     }
     $rules = array('account:required:账号不能为空!', 'password:required:密码不能为空!');
     $info = Validator::check($rules);
     if (!is_array($info) && $info == true) {
         Filter::form(array('sql' => 'account'));
         $account = Filter::sql(Req::args("account"));
         $voucher = $this->model->table("voucher")->where("account='{$account}'")->find();
         if ($voucher && $voucher['password'] == Req::args("password")) {
             if (strtotime($voucher['end_time']) > time()) {
                 if ($voucher['status'] == 0) {
                     $this->model->table("voucher")->data(array('user_id' => $this->user['id'], 'is_send' => 1, 'status' => 0))->where("account='{$account}'")->update();
                     $this->redirect("voucher", false, array('msg' => array("success", "优惠券成功激活!")));
                 } else {
                     $this->redirect("voucher", false, array('msg' => array("warning", "此优惠券已使用过!")));
                 }
             } else {
                 //过期
                 $this->redirect("voucher", false, array('msg' => array("warning", "优惠券已过期!")));
             }
         } else {
             //不存在此优惠券
             $this->redirect("voucher", false, array('msg' => array("error", "优惠券账号或密码错误!")));
         }
     } else {
         //输入信息有误
         $this->redirect("voucher", false, array('msg' => array("info", "输入的信息不格式不正确")));
     }
 }
开发者ID:sammychan1981,项目名称:quanpin,代码行数:32,代码来源:ucenter.php


注:本文中的Filter::form方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。