/** * @param Author $author * @return string */ public function getAuthorUrl(Author $author) { if ($urlKey = $author->getUrlKey()) { $prefix = $this->scopeConfig->getValue(self::URL_PREFIX_CONFIG_PATH, ScopeInterface::SCOPE_STORE); $suffix = $this->scopeConfig->getValue(self::URL_SUFFIX_CONFIG_PATH, ScopeInterface::SCOPE_STORE); $path = ($prefix ? $prefix . '/' : '') . $urlKey . ($suffix ? '.' . $suffix : ''); return $this->urlBuilder->getUrl('', ['_direct' => $path]); } return $this->urlBuilder->getUrl('sample_news/author/view', ['id' => $author->getId()]); }