예제 #1
0
 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;
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function actionSave()
 {
     if ($this->once && $this->exists()) {
         return 0;
     }
     $this->_items = Helper::uniqueConfig($this->_items);
     $this->getFile()->save($this);
 }
예제 #3
0
 public function actionSave()
 {
     $this->_items = Helper::uniqueConfig($this->_items);
     $this->getFile()->save($this->getItems());
     return 0;
 }
예제 #4
0
 public function getTitle()
 {
     return $this->getItem('title') ?: ($this->isDomain() ? $this->name : Helper::titleize($this->name));
 }
예제 #5
0
 /**
  * {@inheritdoc}
  */
 public function options($actionId)
 {
     return array_merge(parent::options($actionId), array_keys(Helper::getPublicVars(get_called_class())));
 }
예제 #6
0
파일: File.php 프로젝트: hiqdev/hidev
 public function getCtype()
 {
     return Helper::id2camel($this->type);
 }
예제 #7
0
 public function getTitle()
 {
     return $this->getItem('title') ?: $this->getItem('description') ?: Helper::titleize($this->name);
 }
예제 #8
0
 public function getTitle()
 {
     return $this->getItem('title') ?: Helper::titleize($this->package);
 }