@param       $name
@param       $controller
@param       $action
@param array $options

@return bool
512576
protected function setResourceCreate($name, $controller, $action, $options = [])
    {
        return $this->mapResource('post', $name, $controller, 'post' . ucfirst($action));
    }
804476
public function controller($uri, $controller, $names = array())
	{
		$prepended = $controller;

		// First, we will check to see if a controller prefix has been registered in
		// the route group. If it has, we will need to prefix it before trying to
		// reflect into the class instance and pull out the method for routing.
		if (count($this->groupStack) > 0)
		{
			$prepended = $this->prependGroupUses($controller);
		}

		$routable = $this->getInspector()->getRoutable($prepended, $uri);

		// When a controller is routed using this method, we use Reflection to parse
		// out all of the routable methods for the controller, then register each
		// route explicitly for the developers, so reverse routing is possible.
		foreach ($routable as $method => $routes)
		{
			foreach ($routes as $route)
			{
				$this->registerInspected($route, $controller, $method, $names);
			}
		}

		$this->addFallthroughRoute($controller, $uri);
	}
1289545
private function _getRoute( $controller_name, $action_name )
    {
        $_route = $this->_createRoute( $controller_name, $action_name );

        foreach( $this->_routes as $route )
        {
            if ( $route->getControllerName() == $_route->getControllerName() && $route->getActionName() == $_route->getActionName() )
            {
                return $route;
            }
        }
    }
1355901
protected function setResourceIndex($name, $controller, $action, $options = [])
    {
        return $this->router->match(
            strtoupper('get'),
            $name,
            function () use ($controller, $action) {
                $args = [$controller . '@' . 'get' . ucfirst($action)];

                return $this->router->callController($args);
            }
        );
    }
300949
public function action(string $action, string $controller)
    {
        $this->options['actions'][strtolower($action)] = $controller;

        return $this;
    }
101238
public function setController($name, $controller=null)
	{
	    if ($name instanceof Controller) {
	        $controller = $name;
	        $sname = $controller->getName();
	    } elseif ($controller instanceof Controller) {
	        $sname = $name && !is_numeric($name) ? $name : $controller->getName();
	    } else {
	        if ($controller) {
	            $class_name = Ioc::findClass($controller, 'controller');
	        } else {
	            $class_name = Ioc::findClass($name, 'controller');
	        }
	        
	        if ($class_name && is_subclass_of($class_name, "\\Wslim\\Console\\Controller")) {
	            $sname = is_numeric($name) ? null : $name;
	            $controller =  new $class_name($sname);
	            if (!$sname) {
	                $sname = $controller->getName();
	            }
	        } else {
	            throw new \LogicException(sprintf('Controller class "%s" is not exists.', $controller));
	        }
	    }
	    
	    if (!$controller->isEnabled()) {
	        return;
	    }
	    
	    if (null === $controller->getDefinition()) {
	        throw new \LogicException(sprintf('Controller class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', get_class($controller)));
	    }
	    
	    $this->controllers[$sname] = $controller;
	    
	    foreach ($controller->getAliases() as $alias) {
	        $this->controllers[$alias] = $controller;
	    }
	    
	    return $controller;
	}
43070
public function autoload($controller,$action){
	
		$className = '\\magazine\\controller\\'.$controller;
		$controller = new $className($this->request);
		if(method_exists($controller,$action)){
			return  call_user_func([$controller, $action]);
		}
		return false;
	}
83834
public function hasResourceParams($controller, $action = null)
    {
        $this->buildAcl();
        $resource = $this->buildResource($controller, $action);
        return parent::hasResource($resource);
    }
570830
public function link($path, $action, array $options = [])
    {
        return $this->action(Method::LINK, $path, $action, $options);
    }
106202
public function isValid($module, $controller, $action) {
		if (!in_array($module, $this->modules, true)) {
			return self::ROUTE_ERR_MODULE;
		}
		$className = EntryUtil::controller($module, $controller);
		if (!Container::getInstance()->has($className)) {
			return self::ROUTE_ERR_CONTROLLER;
		}
		$clazz = Container::getInstance()->get($className);
		if (!method_exists($clazz, $action . 'Action')) {
			return self::ROUTE_ERR_ACTION;
		}
		return self::ROUTE_VALID;
	}
991725
public function any($pattern, $action, $name =  null)
    {
        return $this->addRoute(['*'], $pattern, $action, $name);
    }
1213649
public function apiResource($name, $controller, array $options = [])
    {
        $only = ['index', 'show', 'store', 'update', 'destroy'];

        if (isset($options['except'])) {
            $only = array_diff($only, (array) $options['except']);
        }

        return $this->resource($name, $controller, array_merge([
            'only' => $only,
        ], $options));
    }
716723
public function canAccess($controller, $action, $module = null) {
        $module = is_array($module)?null:$module;
        $rights = $this->getRightsFromMap($controller, $action, $module);
        if ('*' == $rights[0]) {
            return true;
        }
        if ('@' == $rights[0]) {
            return !\mpf\WebApp::get()->user()->isGuest();
        }
        $hasRights = false;
        foreach ($rights as $right) {
            $hasRights = $hasRights || \mpf\WebApp::get()->user()->hasRight($right);
        }
        return $hasRights;
    }
1235792
public function get($name, $options = null)
    {
        if ($this->has($name)) {
            return $this->resolve($name, $options);
        } else {
            $this->throwNotFound($name);
            return false;
        }
    }
1345562
protected function setResourceNew($name, $controller, $action, $options = [])
    {
        return $this->mapResource('get', $name . '/' . $action, $controller, 'get' . ucfirst($action));
    }
363744
protected function addPatchResourceUpdate($name, $base, $controller, $options)
    {
        $uri = $this->getResourceUri($name).'/{'.$base.'}';

        $action = $this->getResourceAction($name, $controller, 'update', $options);

        return $this->router->patch($uri, $action);
    }
154549
protected function addResourceUpdate($name, $base, $controller, $options)
    {
        $this->addPutResourceUpdate($name, $base, $controller, $options);

        return $this->addPatchResourceUpdate($name, $base, $controller);
    }