/** * Url of the origin of this notification * If source is a Content / ContentAddon / ContentContainer this will automatically generated. * * @return string */ public function getUrl() { $url = '#'; if ($this->source instanceof ContentActiveRecord || $this->source instanceof ContentAddonActiveRecord) { $url = $this->source->content->getUrl(); } elseif ($this->source instanceof ContentContainerActiveRecord) { $url = $this->source->getUrl(); } // Create absolute URL, for E-Mails if (substr($url, 0, 4) !== 'http') { $url = \yii\helpers\Url::to($url, true); } return $url; }
/** * Url of the origin of this notification * If source is a Content / ContentAddon / ContentContainer this will automatically generated. * * @return string */ public function getUrl() { if ($this->source instanceof ContentActiveRecord || $this->source instanceof ContentAddonActiveRecord) { return $this->source->content->getUrl(); } elseif ($this->source instanceof ContentContainerActiveRecord) { return $this->source->getUrl(); } return "#"; }