private function generateViewParametersArray($vpString)
    {
        $vpString = trim($vpString, '/');
        $viewParameters = array();

        $vpSegments = explode('/', $vpString);
        for ($i = 0, $iMax = count($vpSegments); $i < $iMax; ++$i) {
            if (empty($vpSegments[$i])) {
                continue;
            }

            // View parameter name.
            // We extract it + the value from the following segment (next element in $vpSegments array)
            if ($vpSegments[$i][0] === '(') {
                $paramName = str_replace(array('(', ')'), '', $vpSegments[$i]);
                // A value is present (e.g. /(foo)/bar)
                if (isset($vpSegments[$i + 1])) {
                    $viewParameters[$paramName] = $vpSegments[$i + 1];
                    unset($vpSegments[$i + 1]);
                } else {
                    // No value (e.g. /(foo)) => set it to empty string
                    $viewParameters[$paramName] = '';
                }
            } elseif (isset($paramName)) {
                // Orphan segment (no previous parameter name), e.g. /(foo)/bar/baz
                // Add it to the previous parameter.
                $viewParameters[$paramName] .= '/' . $vpSegments[$i];
            }
        }

        return $viewParameters;
    }
private function generateViewParametersArray($vpString)
    {
        $vpString = trim($vpString, '/');
        $viewParameters = array();

        $vpSegments = explode('/', $vpString);
        for ($i = 0, $iMax = count($vpSegments); $i < $iMax; ++$i) {
            if (empty($vpSegments[$i])) {
                continue;
            }

            // View parameter name.
            // We extract it + the value from the following segment (next element in $vpSegments array)
            if ($vpSegments[$i][0] === '(') {
                $paramName = str_replace(array('(', ')'), '', $vpSegments[$i]);
                // A value is present (e.g. /(foo)/bar)
                if (isset($vpSegments[$i + 1])) {
                    $viewParameters[$paramName] = $vpSegments[$i + 1];
                    unset($vpSegments[$i + 1]);
                } else {
                    // No value (e.g. /(foo)) => set it to empty string
                    $viewParameters[$paramName] = '';
                }
            } elseif (isset($paramName)) {
                // Orphan segment (no previous parameter name), e.g. /(foo)/bar/baz
                // Add it to the previous parameter.
                $viewParameters[$paramName] .= '/' . $vpSegments[$i];
            }
        }

        return $viewParameters;
    }
private function generateViewParametersArray ( $ vpString ) { $ vpString = trim ( $ vpString , '/' ) ; $ viewParameters = array ( ) ; $ vpSegments = explode ( '/' , $ vpString ) ; for ( $ i = 0 , $ iMax = count ( $ vpSegments ) ; $ i < $ iMax ; ++ $ i ) { if ( empty ( $ vpSegments [ $ i ] ) ) { continue ; } // View parameter name. // We extract it + the value from the following segment (next element in $vpSegments array) if ( $ vpSegments [ $ i ] [ 0 ] === '(' ) { $ paramName = str_replace ( array ( '(' , ')' ) , '' , $ vpSegments [ $ i ] ) ; // A value is present (e.g. /(foo)/bar) if ( isset ( $ vpSegments [ $ i + 1 ] ) ) { $ viewParameters [ $ paramName ] = $ vpSegments [ $ i + 1 ] ; unset ( $ vpSegments [ $ i + 1 ] ) ; } else { // No value (e.g. /(foo)) => set it to empty string $ viewParameters [ $ paramName ] = '' ; } } elseif ( isset ( $ paramName ) ) { // Orphan segment (no previous parameter name), e.g. /(foo)/bar/baz // Add it to the previous parameter. $ viewParameters [ $ paramName ] .= '/' . $ vpSegments [ $ i ] ; } } return $ viewParameters ; }
Generates the view parameters array from the view parameters string.

@param $vpString

@return array
Generates the view parameters array from the view parameters string .