/** * * {@inheritDoc} * @see \yii\base\Object::init() */ public function init() { // parent initializer parent::init(); // atache before render to stop render if not in group $this->on(self::EVENT_BEFORE_RENDER, [$this, 'eventBeforeRender']); }
/** * Get the source of the image, if not available the method returns false. * * @return string|boolean Returns the path to the file, otherwise false. * @see \luya\admin\base\Property::getValue() */ public function getValue() { $value = parent::getValue(); if ($value) { $image = Yii::$app->storage->getImage($value); if ($image) { return $image->source; } } return false; }