Timber\URLHelper::get_params PHP Method

get_params() public static method

Returns the url parameters, for example for url http://example.org/blog/post/news/2014/whatever this will return array('blog', 'post', 'news', '2014', 'whatever'); OR if sent an integer like: TimberUrlHelper::get_params(2); this will return 'news';
public static get_params ( integer $i = false ) : array | string
$i integer the position of the parameter to grab.
return array | string
    public static function get_params($i = false)
    {
        $args = explode('/', trim(strtolower($_SERVER['REQUEST_URI'])));
        $newargs = array();
        foreach ($args as $arg) {
            if (strlen($arg)) {
                $newargs[] = $arg;
            }
        }
        if ($i === false) {
            return $newargs;
        }
        if ($i < 0) {
            //count from end
            $i = count($newargs) + $i;
        }
        if (isset($newargs[$i])) {
            return $newargs[$i];
        }
    }