本文整理匯總了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;
}
示例2: checkUpdate
public function checkUpdate()
{
if (Validate::checkStrLength($_POST['re_content'], 200, 'max')) {
$this->message[] = '回複評價不得大於200位';
$this->flag = false;
}
return $this->flag;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}