src/App/Routing/SluggableTrait.php
public function url($lang = null)
    {
        if ($this->url === null) {
            if (!$this->id()) {
                return null;
            }

            $this->url = $this->generateUri();
        }

        if ($lang && $this->url instanceof Translation) {
            return $this->url[$lang];
        }

        return strval($this->url);
    }
public function url($lang = null)
    {
        if ($this->url === null) {
            if (!$this->id()) {
                return null;
            }

            $this->url = $this->generateUri();
        }

        if ($lang && $this->url instanceof Translation) {
            return $this->url[$lang];
        }

        return strval($this->url);
    }
public function url ( $ lang = null ) { if ( $ this -> url === null ) { if ( ! $ this -> id ( ) ) { return null ; } $ this -> url = $ this -> generateUri ( ) ; } if ( $ lang && $ this -> url instanceof Translation ) { return $ this -> url [ $ lang ] ; } return strval ( $ this -> url ) ; }
Retrieve the object's URI.

@param  string|null $lang If object is multilingual, return the object route for the specified locale.
@return Translation|string|null
Retrieve the object s URI .