Add mapping for OPTIONS method

@param  string $module
@param  string $controller
@return Link
431679
public function options(string $module, string $controller): Link
    {
        return $this->addMap(RequestMethod::OPTIONS, $module, $controller);
    }
375559
public function defaultTemplate ($module, $controller, $action)
	{
		
		// Start template path with the controller module
		
		$template	= $module? $module . '/' : '';
		
		// If theres a controller then add it
		
		if ($controller)
		{
		
			// Split controller and remove the final block if its Index

			$arrController	= explode ('\\', $controller);
			$pop = strtolower (array_pop ($arrController));
			
			if ($pop != 'index')
			{
				$arrController[] = $pop;
			}

			$template	.= join ('/', $arrController) . '/';
				
		}
		
		// Remove initial /
		
		if ($template[0] == '/')
		{
			$template	= substr ($template, 1);
		}
		
		// If there is no template file yet just use the action
		
		$template	.= $action;
		
		// Lowercase and add tpl extension
		
		$template	= strtolower ($template) . '.tpl';
		
		// Return template
		
		return $template;
		
	}
880595
public function addMap($pattern, $controller = null)
    {
        if (!is_string($controller)) {
            throw new \InvalidArgumentException(
                'Please give me controller name string. ' . ucfirst(gettype($controller)) . ' given.'
            );
        }

        if ($pattern instanceof Route) {
            throw new \LogicException('Do not use Route object in ' . get_called_class());
        }

        return parent::addRoute(null, $pattern, ['_controller' => $controller]);
    }
574460
protected function makeController($controller)
	{
		Controller::setFilterer($this->filterer);

		return $this->container->make($controller);
	}
876829
public function addMap($method, $module, $controller): Link
    {
        return $this->map[strtoupper($method)] = new Link($module, $controller);
    }
95120
protected function bindToController($request, $url, $controller)
    {
        $array  = explode('|', $url, 2);
        $action = !empty($array[0]) ? $array[0] : $this->router->config('default_action');
        $param  = [];

        if (!empty($array[1])) {
            $this->parseUrlParams($request, $array[1], $param);
        }

        return new ControllerDispatch($request, $this, $controller . '/' . $action, $param);
    }
218730
public static function mvcDispatcher($module, $controller, $action, $params)
    {
        $dispatcher = new self;
        $dispatcher->setModule($module);
        $dispatcher->setController($controller);
        $dispatcher->setAction($action);
        $dispatcher->setParams($params);

        // get current application config
        $applicationConfig = Bootstrap::getInstance()->getEnvironment()->getApplicationConfig();

        // build the class name
        $className = '\\' . $applicationConfig->Namespace . '\Modules\\' . $dispatcher->getModule() . '\Controllers\\' . $dispatcher->getController();
        $dispatcher->setClassName($className);

        return $dispatcher;
    }
1366254
static function getController($module_name,$controller_name,$request,$view) {
        static $ctrls = NULL;
        $module_name  = strtolower($module_name);
        $controller_name = strtolower($controller_name);
        if (!$ctrls[$module_name][$controller_name]) {
            $controller = ucfirst($controller_name) . 'Controller';
            $controller_class = '\\' . self::getName() . '\\Controller\\' . ucfirst($module_name) . '\\' . $controller;
            if (!class_exists($controller_class)) {
                throw new Controller\NoControllerException;
            }
            $c = new $controller_class($request,$view);
            $ctrls[$module_name][$controller_name] = $c;
        }
        return $ctrls[$module_name][$controller_name];
    }
422493
public static function redirectTo($module, $controller = 'index', array $params = []): void
    {
        $url = Router::getFullUrl($module, $controller, $params);
        self::redirect($url);
    }
227880
public function mapUrl($controller, array $args = array(), $index = 0)
    {
        return $this->urlBuilder->createUrl($controller, $args, $index);
    }
667648
public function setModule($module)
        {
            if (null !== $module && !is_string($module)) {
                throw new Exception(
                    'Invalid argument: $module must be a string or null'
                );
            }

            $this->_module    = $module;
            $this->_hrefCache = null;

            return $this;
        }
1276604
public static function getClass($controller)
    {
        $config = Config::getInstance();
        $siteModules = array_reverse($config->get('ModuleManager')->getEnabled());

        foreach ($siteModules as $namespace => $modules) {
            foreach ($modules as $module) {
                $class = "\\{$namespace}\\{$module}\\Admin\\Controller\\{$controller}Controller";

                if (class_exists($class)) {
                    return $class;
                }
            }
        }

        return null;
    }
497950
public static function isModule(string $module, string $controller = null, string $action = null): bool
    {
        $route = Application::route();
        if ($module === $route->getModuleUrl()) {
            if ($controller === null) {
                return true;
            } else {
                if ($controller === $route->getControllerUrl()) {
                    // now we have matched module and controller
                    if ($action === null) {
                        return true;
                    } else {
                        return ($action === $route->getActionUrl());
                    }
                } else {
                    return false;
                }
            }
        } else {
            return false;
        }
    }
489615
public function get(string $module, string $controller): Link
    {
        return $this->addMap(RequestMethod::GET, $module, $controller);
    }
52951
protected function getRightsFromMap($controller, $action, $module) {
        list ($rController, $allController) = $this->getRawAndModuleControllers($controller, $module);
        if (isset($this->finalMap[$rController][$action])) {
            return $this->finalMap[$rController][$action];
        } elseif (isset($this->finalMap[$allController][$action])) {
            return $this->finalMap[$allController][$action];
        } elseif (isset($this->finalMap[$rController]['*'])) {
            return $this->finalMap[$rController]['*'];
        } elseif (isset($this->finalMap[$allController]['*'])) {
            return $this->finalMap[$allController]['*'];
        } elseif (isset($this->finalMap['*'][$action])) {
            return $this->finalMap['*'][$action];
        } elseif (isset($this->finalMap['*']['*'])) {
            return $this->finalMap['*']['*'];
        } else {
            return array('*');
        }
    }
1211720
public function add($uri, $method, $controller, $action) {
        $this->currentRoute = [
            'uri' => $uri,
            'method' => $method,
            'controller' => $controller,
            'action' => $action,
            'module' => $this->module,
        ];

        if ($this->currentGroupName) {
            $this->virtualRoutes[$this->currentGroupName][] = $this->currentRoute;
        } else {
            $this->virtualRoutes['*'][] = $this->currentRoute;
        }

        return $this;
    }
347279
final protected function createUrl($controller, array $args = array(), $index = 0)
    {
        if (ArrayUtils::isAssoc($args)) {
            return $this->urlBuilder->createQueryUrl($controller, $args, $index);
        } else {
            return $this->urlBuilder->createUrl($controller, $args, $index);
        }
    }