摘要:
public function rules() { return[ [['groupname','bandwidth'],'required'],//不为空验证 [['id','bandwidth'], 'integer'],//整数验证 [['note'], 'safe' ],//安全验证 [[' 阅读全文
posted @ 2020-07-17 16:07
$Elvin
阅读(414)
评论(0)
推荐(0)
摘要:
// 判断字段是否存在模型中 if (!$model->hasAttribute($key)) { $this->failReturn('#100010', Yii::t('app', 'fieldnotexist')); } hasAttribute函数检测字段是否存在模型中 阅读全文
posted @ 2020-07-17 15:03
$Elvin
阅读(633)
评论(0)
推荐(0)
摘要:
use linslin\yii2\curl\Curl;// 引入命名空间 // 实例化Curl类 $curl = new Curl(); // 设置请求类型 $curl = $curl->setHeaders([ 'Content-Type' => 'application/json', ]); / 阅读全文
posted @ 2020-07-17 14:59
$Elvin
阅读(410)
评论(0)
推荐(0)