本文整理匯總了PHP中app\models\Property::search方法的典型用法代碼示例。如果您正苦於以下問題:PHP Property::search方法的具體用法?PHP Property::search怎麽用?PHP Property::search使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\Property
的用法示例。
在下文中一共展示了Property::search方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionGroup
public function actionGroup($id = null)
{
if ($id === null) {
$model = new PropertyGroup();
} else {
$model = PropertyGroup::findById($id);
}
if ($model->load(\Yii::$app->request->post()) && $model->validate()) {
$save_result = $model->save();
if ($save_result) {
Yii::$app->session->setFlash('success', Yii::t('app', 'Record has been saved'));
$returnUrl = Yii::$app->request->get('returnUrl', ['/backend/properties/index']);
switch (Yii::$app->request->post('action', 'save')) {
case 'next':
return $this->redirect(['/backend/properties/group', 'returnUrl' => $returnUrl]);
case 'back':
return $this->redirect($returnUrl);
default:
return $this->redirect(['/backend/properties/group', 'id' => $model->id, 'returnUrl' => $returnUrl]);
}
} else {
Yii::$app->session->setFlash('error', Yii::t('app', 'Cannot save data'));
}
}
$searchModel = new Property();
$searchModel->property_group_id = $model->id;
$dataProvider = $searchModel->search($_GET);
return $this->render('group', ['model' => $model, 'dataProvider' => $dataProvider, 'searchModel' => $searchModel]);
}