public function matches($uri)
    {
        if (!preg_match($this->compiledRegex, $uri, $matches)) {
            return false;
        }

        $params = array();
        foreach ($matches as $key => $value) {

            /** gestion des sous-repertoires : uniquement si controller contient des _ */
            if ($key == 'controller' && substr_count($value, '_')) {
                $temp = explode('_', $value);
                $value = array_pop($temp);
                $params['directory'] = implode('/', $temp);
            }
            // Set the value for all matched keys
            $params[$key] = $value;
        }

        return array_merge($this->defaults, $params);
    }