コード例 #1
0
ファイル: Component.php プロジェクト: worstinme/yii2-zoo
 public function config($name, $default = null)
 {
     if (($config = Config::find()->where(['name' => $name])->one()) !== null) {
         return $config->value;
     }
     return $default;
 }
コード例 #2
0
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => Config::find()]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }