Alias for Collector::controllers but maps a controller without using the controller name as prefix.

@param string[] $controllers
@throws \ReflectionException
@return Group
774596
public function controllersWithoutPrefix(array $controllers)
    {
        $group = new Group;
        foreach ($controllers as $controller)
            $group->set($this->controllerWithoutPrefix($controller));
        return $group;
    }
369843
protected function addGroupNamespace($controller)
    {
        if (! empty($this->groupStack)) {
            $group = end($this->groupStack);

            if (isset($group['namespace']) && strpos($controller, '\\') !== 0) {
                return $group['namespace'].'\\'.$controller;
            }
        }

        return $controller;
    }
889133
public function getController($key) {
        if (isset($this->_controllers[$key])) {
            return $this->_controllers[$key];
        }

        throw new MissingControllerException(sprintf('Controller %s does not exist', $key));
    }
738893
private function getControllerMethods ($controller)
	{
		
		// Check controller exists
		
		if (!\Sonic\Sonic::_classExists (__NAMESPACE__ . '\\' . $controller))
		{
			return array ();
		}
		
		// Set actions
		
		$actions	= array ();
		
		/**
		 * Reflect controller
		 */
		
		$reflection	= new \ReflectionClass (__NAMESPACE__ . '\\' . $controller);
		$className	= $reflection->getName ();
		
		// Get class methods
		
		foreach ($reflection->getMethods () as $method)
		{
			
			// Dont use methods from parent classes
			
			if ($method->getDeclaringClass ()->getName () != $className)
			{
				continue;
			}
			
			// Skip unless the method is public
			
			if (!$method->isPublic ())
			{
				continue;
			}
			
			// Skip methods starting with __
			
			if (substr ($method->getName (), 0, 2) == '__')
			{
				continue;
			}
			
			// Get class name and comment
			
			$name		= $method->getName ();
			$comment	= new \Sonic\Model\Tools\Comment ($method->getDocComment ());
			
			// Skip if @ignore is set in the method comment
			
			if ($comment->hasTag ('ignore'))
			{
				continue;
			}
			
			// Add action
			
			$actions[$name] = array (
				'description'	=> $comment->getShortDescription (),
				'notes'			=> $comment->getLongDescription (),
				'url'			=> URL_ROOT . str_replace ('\\', '/', strtolower ($controller)) . '/' . $name,
				'auth'			=> FALSE
			);
			
			// Deal with authenticated method
			
			if ($comment->hasTag ('authenticated'))
			{
				$actions[$name]['auth']	= TRUE;
			}
			
			// Add method parameters
			
			$params	= $comment->getTags ('param');
			
			if ($params)
			{
				
				foreach ($params as $param)
				{
					
					if (!preg_match ('/^(\w+)\s+\$([\w\d]+)\s*(.*?)$/', $param, $arr))
					{
						continue;
					}
					
					$actions[$name]['param'][]	= array (
						'type'			=> $arr[1],
						'name'			=> $arr[2],
						'description'	=> $arr[3]
					);
					
				}
				
			}
			
		}
		
		// Return actions
		
		return $actions;
		
	}
748984
private function pushControllersInDefinition($alias_namespace, $controllers_directory, &$default_definitions)
    {
        $controller_files = get_files($controllers_directory);
        if (!empty($controller_files))
        {
            $controllers = array_map(function($controller) use($controllers_directory) {
                $new_controller = str_replace("{$controllers_directory}/", "", $controller);
                return basename(str_replace("/", "\\", $new_controller), ".php");
            }, $controller_files);

            $errors = [];

            foreach ($controllers as $controller) {
                if ($alias_namespace === "\\")
                {
                    $controller_definition = $controller;
                    $controller_definition_value = get_app_namespace() . "Controllers\\{$controller}";
                }
                else
                {
                    $module_name = str_replace("App\\", "", $alias_namespace);

                    $controller_sub_namespace = str_replace(app_path() . "/{$module_name}/Controllers", "", $controllers_directory);
                    $controller_sub_namespace = str_replace("/", "\\", $controller_sub_namespace);

                    $controller_definition = "{$alias_namespace}{$controller}";
                    $controller_definition_value = "{$alias_namespace}Controllers\\{$controller}";
                }

                if (!array_key_exists("{$controller_definition}", $default_definitions))
                {
                    $default_definitions["{$controller_definition}"] = function(ContainerInterface $c) use ($controller_definition_value)
                    {
                        return new $controller_definition_value($c);
                    };
                }
                else
                {
                    $errors[] = "{$controller} is already exist inside of definitions.";
                }
            }

            if (!empty($errors))
            {
                exit("Error: Please fix the ff. before run the application: <li>" . implode("</li><li>", $errors));
            }
        }
        else
        {
            exit("Error: No controller found in {$controllers_directory} path.");
        }
    }
1322961
public function controller($controller)
    {

        // Instantiate a string controller
        if (is_string($controller)
            && class_exists($controller)
            && is_subclass_of($controller, 'Bkwld\Decoy\Controllers\Base')) {
            $this->controller_name = $controller;
            $this->controller = new $controller;

            // Apply the parent if one was set
            if ($this->parent_item && $this->controller) {
                $this->controller->parent($this->parent_item);
            }

        // Or, validate a passed controller instance
        } elseif (is_object($controller)
            && is_a($controller, 'Bkwld\Decoy\Controllers\Base')) {
            $this->controller_name = get_class($controller);
            $this->controller = $controller;
        }

        // Chain
        return $this;
    }
961436
public function controller( $uri, $controller, $names = [] )
	{
		$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 ( !empty( $this->groupStack ) )
			$prepended = $this->prependGroupUses( $controller );

		$routable = ( new ControllerInspector )->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 );
	}
1264795
public function addGroup(...$groups)
    {
        collect($groups)->map(function ($group) {
            $this->route['groups'][] = $group->get();
        });

        return $this;
    }
929861
public function setController($controller)
    {
        $context = $this->_context;

        $context->controller = Text::camelize($controller);

        return $this;
    }
284278
public function indexByController( $controller ){
		$routes		= array();
		foreach( $this->routes as $route ){
			if( $route->getController() === $controller ){
				$routes[]	= $route;
			}
		}
		return $routes;
	}
1055786
private function registerControllerFilters($controller, $controllerService, $filters)
    {
        foreach ($filters as $filter) {
            if ($filter instanceof Before) {
                foreach ($filter->methods as $method) {
                    $this->registerFilter($method, 'before', $controller, $controllerService);
                }
            }

            if ($filter instanceof After) {
                foreach ($filter->methods as $method) {
                    $this->registerFilter($method, 'after', $controller, $controllerService);
                }
            }
        }
    }
751070
protected function setControllerVars($controller)
    {
        $this->controller = $controller;

        if (is_callable($controller)) {
            $this->setControllerCallable($controller);
        } else {
            $this->usesCallable = false;
            $atCharPos = strpos($controller, '@');

            // Make sure the "@" is somewhere in the middle of the string
            if ($atCharPos === false || $atCharPos === 0 || $atCharPos === mb_strlen($controller) - 1) {
                throw new InvalidArgumentException('Controller string is not formatted correctly');
            }

            $this->controllerName = substr($controller, 0, $atCharPos);
            $this->controllerMethod = substr($controller, $atCharPos + 1);
        }
    }
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);
	}
1206824
protected function mapRoute(): Controller
    {
        foreach ($this->routes['get'] as $pattern => $func) {
            $this->mapStaticRoutes($pattern, $func);
        }

        foreach ($this->routes['post'] as $pattern => $func) {
            $this->mapStaticRoutes($pattern, $func, 'post');
        }

        return $this;
    }
1372187
public function getController($matches = [])
    {

        if (!isset($this->route['controller'])) {
            return false;
        }
        $controller = $this->route['controller'];
        preg_match("/.+?(?=Controllers)(.*)@/", $controller, $matches);
        if (!isset($matches[1])) {
            return false;
        }
        return str_ireplace(['Controllers', 'Controller', '\\'], "", $matches[1]);
    }
959026
public function addControl(Control ...$controls): ControlCollection
    {
        foreach ($controls as $control) {
            $control->setForm($this);
            $this->controls[$control->getName()] = $control;
        }

        return $this;
    }
1351987
protected function setIndexRoute($controller, $action): Controller
    {
        $this->routes['get'] = [
            "/$controller/" => Inflector::classify($controller) . '@' . $action,
            "/$controller/$action/{:id}" => Inflector::classify($controller) . '@' . $action,
            "/$controller/$action/" => Inflector::classify($controller) . '@' . $action,
        ];

        return $this;
    }