Esempio n. 1
0
 public function load($model)
 {
     /*$c=new Config;
     		$c->model='picture';
     		$c->item='size';
     		$c->variant='small';
     		$c->value=serialize([
     			'width'=>256,
     			'height'=>256,
     			'scale'=>'out'
     		]);*/
     if (!$c->save()) {
         print_r($c->errors);
     }
     $values = Config::find()->where(['model' => $model])->all();
     foreach ($values as $o) {
         $this->_values[$o->item][$o->variant] = $o;
         $this->items[$o->item][$o->variant] = unserialize($o->value);
     }
 }
Esempio n. 2
0
 /**
  * Lists all Config models.
  * @return mixed
  */
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => Config::find()]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }