public function getSection($file, $default = null) { $view = Yii::$app->getView(); $tpl = Helper::file2template($file); try { $res = $view->render($tpl, ['config' => $this->takeConfig()]); } catch (\Exception $e) { $res = ''; } return $res ?: $default; }
/** * {@inheritdoc} */ public function actionSave() { if ($this->once && $this->exists()) { return 0; } $this->_items = Helper::uniqueConfig($this->_items); $this->getFile()->save($this); }
public function actionSave() { $this->_items = Helper::uniqueConfig($this->_items); $this->getFile()->save($this->getItems()); return 0; }
public function getTitle() { return $this->getItem('title') ?: ($this->isDomain() ? $this->name : Helper::titleize($this->name)); }
/** * {@inheritdoc} */ public function options($actionId) { return array_merge(parent::options($actionId), array_keys(Helper::getPublicVars(get_called_class()))); }
public function getCtype() { return Helper::id2camel($this->type); }
public function getTitle() { return $this->getItem('title') ?: $this->getItem('description') ?: Helper::titleize($this->name); }
public function getTitle() { return $this->getItem('title') ?: Helper::titleize($this->package); }