예제 #1
0
 public function init()
 {
     parent::init();
     if (isset($this->default)) {
         $this->setValue($this->default);
     }
 }
예제 #2
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (isset($this->default)) {
         $this->setValue($this->default);
     }
     if (!isset($this->format)) {
         throw new InvalidConfigException(Yii::t('gromver.models', __CLASS__ . '::format must be set for {attribute} attribute', ['attribute' => $this->getAttribute()]));
     }
 }