public function addFromConfig(array $config)
    {
        foreach ($config as $name => $data) {
            $params     = isset($data['params']) ? $data['params'] : array();
            $parameters = array();
            foreach ($params as $nameParam => $param) {
                if (empty($params['type'])) {
                    $params['type'] = 'string';
                }

                switch ($param['type']) {

                    case 'int':
                        $param['type'] = Parameter::TYPE_INTEGER;
                        break;

                    case 'mixed':
                        $param['type'] = Parameter::TYPE_MIXED;
                        break;

                    case 'string':
                        $param['type'] = Parameter::TYPE_STRING;
                        break;

                    default:
                        // Consider  current value as regexp
                }
                $parameters[$nameParam] = new Parameter($nameParam, $param['type'], (bool) $param['mandatory']);
            }
            $this->add(new Route($name, $data['route'], $data['controller'], $parameters));
        }

        return $this;
    }