/** * @param string $type * @param string $name * @return Dictionary * @throws NotFoundHttpException */ protected function findModel($type, $name) { $dictionaryModel = Dictionary::findOne(['type' => $type, 'name' => $name]); if (!$dictionaryModel) { throw new NotFoundHttpException('The requested page does not exist.'); } return $dictionaryModel; }
public function dictionary($type, $options = []) { return $this->dropDownList(Dictionary::getLabels($type), $options); }