/** * Returns an array of the default params that are passed to a view * * @param Setting $model The model that has to be passed to the view * @return array */ protected function getDefaultViewParams($model = null) { return ['model' => $model, 'categories' => SettingCategory::find()->all(), 'module' => $this->module]; }
/** * @return \yii\db\ActiveQuery */ public function getCategory() { return $this->hasOne(SettingCategory::className(), ['id' => 'category_id']); }