public function getSegments($named = false) {
        if (!empty($this->segments)) {
            return $named === true ? $this->segmentsNamed : $this->segments;
        }

        // required parameters
        $required = $this->defaults;

        // escape special characters
        $safeTemplate = $this->escapeTemplate($this->template);

        // extract segments
        $this->segments = $this->extractSegments($this, $safeTemplate, $required);

        return $named === true ? $this->segmentsNamed : $this->segments;
    }
public function getSegments($named = false) {
        if (!empty($this->segments)) {
            return $named === true ? $this->segmentsNamed : $this->segments;
        }

        // required parameters
        $required = $this->defaults;

        // escape special characters
        $safeTemplate = $this->escapeTemplate($this->template);

        // extract segments
        $this->segments = $this->extractSegments($this, $safeTemplate, $required);

        return $named === true ? $this->segmentsNamed : $this->segments;
    }
public function getSegments ( $ named = false ) { if ( ! empty ( $ this -> segments ) ) { return $ named === true ? $ this -> segmentsNamed : $ this -> segments ; } // required parameters $ required = $ this -> defaults ; // escape special characters $ safeTemplate = $ this -> escapeTemplate ( $ this -> template ) ; // extract segments $ this -> segments = $ this -> extractSegments ( $ this , $ safeTemplate , $ required ) ; return $ named === true ? $ this -> segmentsNamed : $ this -> segments ; }
Returns segments of the route.

@param bool $named Specify whether to return a named collection (true) or array (false, default).

@var RouteSegment[]
Returns segments of the route .