今天保存出错,但是什么也没提示,所以就查了下,怎么输出错误

$model->save();

$model->getErrors();

获取,刚插入数据的id

$reply->save();

$reply->attributes['id'];

"keyword != '' and keyword is not null and keyword != '*'"

YourModel::find()
    ->andWhere(['!=','keyword',''])
    ->andWhere(['is not','keyword',null])
    ->andWhere(['!=','keyword','*'])
    ->All();

name!=aa and  order_id=1 and status=1

YourModel::find()->where(['and',['!=','name','aa'],['order_id'=>$order_id,'status'=>1]])

 Yii生成URL

echo Url::toRoute(['page', 'id' => 'contact']);
 
echo Url::toRoute('post/index');
 
echo \Yii::$app->urlManager->createUrl(['site/page', 'id' => 'about']);

 

相关文章:

  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
  • 2021-08-21
  • 2021-05-29
  • 2022-02-28
  • 2021-12-19
  • 2021-08-17
猜你喜欢
  • 2022-01-12
  • 2021-10-07
  • 2021-08-29
  • 2022-03-06
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案