Yosymfony\Spress\Core\Plugin\Event\RenderEvent::prepareUrl PHP Method

prepareUrl() protected method

Prepare a URL.
protected prepareUrl ( string $url ) : string
$url string The relative URL
return string
    protected function prepareUrl($url)
    {
        if (empty($url)) {
            throw new \RuntimeException(sprintf('Empty URL at item with id: "%s"', $this->getId()));
        }
        if (stripos($url, '://') !== false) {
            throw new \RuntimeException(sprintf('Malformed relative URL at item with id: "%s"', $this->getId()));
        }
        if (stripos($url, '/') !== 0) {
            throw new \RuntimeException(sprintf('Relative URL must start with "/" at item with id: "%s"', $this->getId()));
        }
        return $url;
    }