Exemplo n.º 1
0
 public function init()
 {
     parent::init();
     if (isset($this->default)) {
         $this->setValue($this->default);
     }
 }
Exemplo n.º 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()]));
     }
 }