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


PHP Validate::checkStrLength方法代码示例

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


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

示例1: checkAdd

 public function checkAdd(&$model, array $param)
 {
     if (Validate::isNullStr($_POST['name'])) {
         $this->message[] = '物流公司名称不得为空';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['url'])) {
         $this->message[] = '物流公司网址不得为空';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['url'], 40, 'max')) {
         $this->message[] = '品牌网址不得大于40位';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['price_in'])) {
         $this->message[] = '省内起步费用必须为数字';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['price_out'])) {
         $this->message[] = '省外起步费用必须为数字';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['price_add'])) {
         $this->message[] = '额外费用必须为数字';
         $this->flag = false;
     }
     if ($model->isOne($param)) {
         $this->message[] = '该物流公司已被占用';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:32,代码来源:DeliveryCheck.class.php

示例2: checkUpdate

 public function checkUpdate()
 {
     if (Validate::checkStrLength($_POST['re_content'], 200, 'max')) {
         $this->message[] = '回复评价不得大于200位';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:8,代码来源:CommendCheck.class.php

示例3: checkAdd

 public function checkAdd(&$model, array $param)
 {
     if (Validate::isNullStr($_POST['name'])) {
         $this->message[] = '商品名不得为空';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['nav'])) {
         $this->message[] = '种类不得为空';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['sn'])) {
         $this->message[] = '编号不得为空';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['weight'])) {
         $this->message[] = '商品重量必须为数字';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['price_sale'])) {
         $this->message[] = '商品销售价必须为数字';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['price_market'])) {
         $this->message[] = '商品成本价必须为数字';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['price_cost'])) {
         $this->message[] = '商品成本价必须为数字';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['inventory'])) {
         $this->message[] = '库存必须为数字';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['warn_inventory'])) {
         $this->message[] = '库存告急必须为数字';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['name'], 20, 'max')) {
         $this->message[] = '商品名不得大于20位';
         $this->flag = false;
     }
     if ($model->isOne($param)) {
         $this->message[] = '商品已被占用';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:48,代码来源:GoodsCheck.class.php

示例4: checkUpdate

 public function checkUpdate(&$model)
 {
     if (Validate::isNullStr($_POST['link'])) {
         $this->message[] = '链接地址不得为空';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['thumb'])) {
         $this->message[] = '图片地址不得为空';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['link'], 40, 'max')) {
         $this->message[] = '链接地址不得大于50位';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:16,代码来源:RotatorCheck.class.php

示例5: checkUpdate

 public function checkUpdate(&$model)
 {
     if (Validate::isNullStr($_POST['url'])) {
         $this->message[] = '品牌网址不得为空';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['type'])) {
         $this->message[] = '品牌类型不得为空';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['info'], 200, 'max')) {
         $this->message[] = '品牌简介不得大于20位';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['url'], 40, 'max')) {
         $this->message[] = '品牌网址不得大于20位';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:20,代码来源:BrandCheck.class.php

示例6: checkAdd

 public function checkAdd(&$model, array $param)
 {
     if (Validate::checkStrLength($_POST['name'], 20, 'max')) {
         $this->message[] = '售后服务名称不得超过20位';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['name'])) {
         $this->message[] = '售后服务名称不得为空';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['content'])) {
         $this->message[] = '售后服务内容不得为空';
         $this->flag = false;
     }
     if ($model->isOne($param)) {
         $this->message[] = '该售后服务已被占用';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:20,代码来源:ServiceCheck.class.php

示例7: checkAdd

 public function checkAdd(&$model, array $param)
 {
     if (Validate::checkStrLength($_POST['name'], 2, 'min')) {
         $this->message[] = '属性名长度不得小于2位';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['name'])) {
         $this->message[] = '属性名不得为空';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['name'], 4, 'max')) {
         $this->message[] = '属性名长度不得大于4位';
         $this->flag = false;
     }
     if ($model->isOne($param)) {
         $this->message[] = '属性名已被占用';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:20,代码来源:AttrCheck.class.php

示例8: checkLogin

 public function checkLogin(&$model, array $param)
 {
     if (Validate::checkStrLength($_POST['user'], 2, 'min')) {
         $this->message[] = '管理员用户名长度不得小于2位';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['user'], 20, 'max')) {
         $this->message[] = '管理员用户名长度不得大于20位';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['pwd'], 6, 'min')) {
         $this->message[] = '密码不得小于6位';
         $this->flag = false;
     }
     if (!$model->isOne($param)) {
         $this->message[] = '用户名或密码不正确';
         $this->flag = false;
     }
     if (!Validate::checkStrEquals(strtolower($_POST['validateCode']), $_SESSION['validateCode'])) {
         $this->message[] = '验证码不正确';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:24,代码来源:ManageCheck.class.php

示例9: checkAdd

 public function checkAdd(&$model, array $param)
 {
     if (Validate::isNullStr($_POST['name'])) {
         $this->message[] = '收货人长度不得小于2位';
         $this->flag = false;
     }
     if (!Validate::isLength($_POST['code'], 6)) {
         $this->message[] = '邮政编码必须为6位';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['name'], 20, 'max')) {
         $this->message[] = '收货人不得大于20位';
         $this->flag = false;
     }
     if (!Validate::checkEmail($_POST['email'])) {
         $this->message[] = '邮箱格式不正确';
         $this->flag = false;
     }
     if ($model->isOne($param)) {
         $this->message[] = '收货人已被占用';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:24,代码来源:AddressCheck.class.php


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