src/Menu/Menu.php
protected function getRouteAndParameters($params)
    {
        if (is_string($params)) {
            return [$params, []];
        }

        return [
            // The first position in the array is the route or action name
            array_shift($params),
            // After that they are parameters and they could be dynamic
            $this->replaceDynamicParameters($params)
        ];
    }
protected function getRouteAndParameters($params)
    {
        if (is_string($params)) {
            return [$params, []];
        }

        return [
            // The first position in the array is the route or action name
            array_shift($params),
            // After that they are parameters and they could be dynamic
            $this->replaceDynamicParameters($params)
        ];
    }
protected function getRouteAndParameters ( $ params ) { if ( is_string ( $ params ) ) { return [ $ params , [ ] ] ; } return [ // The first position in the array is the route or action name array_shift ( $ params ) , // After that they are parameters and they could be dynamic $ this -> replaceDynamicParameters ( $ params ) ] ; }
Retrieve a route or action name and its parameters

If $params is a string, then it returns it as the name of the route or
action and the parameters will be an empty array.

If it is an array then it takes the first element as the name of the
route or action and the other elements as the parameters.

Then it will try to replace any dynamic parameters (relying on the
replaceDynamicParameters method, see below)

Finally it will return an array where the first value will be the name of
the route or action and the second value will be the array of parameters.

@param $params
@return array
Retrieve a route or action name and its parameters