Creates a Dispatcher instance from a class name.

@param string $className Fully qualified class name.
@param string $action Action name.
@param array  $params Parameters.

@return Dispatcher
428324
public static function customDispatcher($className, $action, $params)
    {
        $dispatcher = new self;
        $dispatcher->setClassName($className);
        $dispatcher->setAction($action);
        $dispatcher->setParams($params);

        return $dispatcher;
    }
1112340
public function createEvent($eventName, array $params = array())
    {
        $class = $this->eventClass;
        return new $class($this->sender, $this->prefix . $eventName, $params);
    }
115562
public function execute($action, array $parameters = []) {
        $result = null;
        if (is_string($action)) {
            $actionParts = explode("@", $action);
            $controllerClass = $actionParts[0];
            $controllerMethodName = sizeof($actionParts) > 1 ? $actionParts[1] : "index";
            $controller = Controllers::get($controllerClass);
            if ($controller == null) {
                throw new ActionNotFoundException ( "Controller \"$controllerClass\" not found !!");
            }
            if (method_exists($controller, $controllerMethodName)) {
                $controllerMethodParams = $this->getParameterValues(new ReflectionMethod($controller, $controllerMethodName), $parameters);
                $result = call_user_func_array([$controller, $controllerMethodName], $controllerMethodParams);
            }
            else {
                throw new ActionNotFoundException ("Method \"$controllerMethodName\" not found in controller \"$controllerClass\" !!");
            }
        }
        else if (is_callable($action)) {
            $actionParams = $this->getParameterValues(new ReflectionFunction($action), $parameters);
            $result = call_user_func_array($action, $actionParams);
        }
        return $result;
    }
1165642
public static function getActionUrl($action = 'index', $params = [])
    {
        $params = is_array($params) ? $params : ['id' => $params];

        return array_merge([implode('/', ['', static::moduleId(), static::controllerId(), $action])], $params);
    }
984689
protected function callAction(ControllerInterface $class, $action, $arguments, array $data)
    {
        if (null !== $this->action || $this->action->getName() !== $this->action) {
            $this->action = new \ReflectionMethod($class, $action);
        }

        $params = [];

        $dataBox = new Param($data);

        foreach ($arguments as $argument) {
            $params[$argument->name] = $dataBox->get($argument->name, $argument->defaultValue);
        }

        return $this->action->invokeArgs($class, $params);
    }
518310
public static function toSearch(string $modelName, array $params = [], string $action = 'index')
    {
        $formName = Inflector::id2camel($modelName) . 'Search';

        return static::toAction($modelName, [$formName => $params], $action);
    }
934098
public function createClassConstantReference(string $className): ClassConstFetch
    {
        $nameNode = new FullyQualified($className);

        return $this->builderFactory->classConstFetch($nameNode, 'class');
    }
69000
private function callClassController($controller, $action)
    {
        if (!class_exists($controller)) {
            throw new AppException(sprintf('Invalid class name or class "%s" does not exists', $controller));
        }

        $instance = new $controller($this);

        if ($res = $this->callMethod($instance, 'before')) {
            return $res;
        }

        if (false === $response = $this->callMethod($instance, $action)) {
            throw new AppException(sprintf('Unable to call action "%s" on controller "%s"', $action, $controller));
        }

        if ($res = $this->callMethod($instance, 'after')) {
            return $res;
        }

        return $response;
    }
1262628
function dispatch($action_name) {
        if (method_exists($this, '_init')) {
            $this->_init();
        }
        $action = self::getActionMethodName($action_name);
        if (method_exists($this, $action)) {
            return $this->$action();
        } else {
            throw new NoActionException;
        }
    }
199916
protected function forward(string $controller, array $action = [], array $params = [])
    {
        return $this->dispatcher->forward([
            'handler' => $controller,
            'action' => $action,
            'params' => $params,
        ]);
    }
876947
public function handleAction($action, $actionParams)
    {
        $response = new b8\Http\Response\JsonResponse();
        try {
            $data = parent::handleAction($action, $actionParams);
            if (isset($data['responseCode'])) {
                $response->setResponseCode($data['responseCode']);
                unset($data['responseCode']);
            }
            $response->setContent($data);
        } catch (Exception $ex) {
            $response->setResponseCode(500);
            $response->setContent(array('status' => 'failed', 'error' => $ex->getMessage()));
        }
        return $response;
    }
955446
public function action(callable $action, $params = [], &$result = null)
    {
        return $this->db->action($action, $params, $result);
    }
871188
protected function createFormInstance(string $className, array $params)
    {
        $result = new $className ($this->getTranslator(), $this->getValidator(), $this->getOptions(), $params);

        return $result;
    }
840302
public function dispatch($action, array $parameters = [])
    {
        $parameters['key'] = $this->config('public_key');
        $parameters['sum'] = $this->summary(array_merge($parameters, [
            'action'  => $action,
            'version' => self::VERSION,
        ]));
        $uri = (new UriTemplate())->expand(self::HOST.'{/segments*}{?parameters*}', [
            'segments'   => [
                self::VERSION, $action,
            ],
            'parameters' => $parameters,
        ]);

        return (new Client())->get($uri);
    }
999869
protected function execPageAction($actionName, $parameters)
    {
        $result = null;

        if (!$this->actionExists($actionName)) {
            if (Config::get('app.debug', false)) {
                throw new SystemException(sprintf(
                    "Action %s is not found in the controller %s",
                    $actionName,
                    get_class($this)
                ));
            } else {
                Response::make(View::make('backend::404'), 404);
            }
        }

        // Execute the action
        $result = call_user_func_array([$this, $actionName], $parameters);

        // Expecting \Response and \RedirectResponse
        if ($result instanceof \Symfony\Component\HttpFoundation\Response) {
            return $result;
        }

        // No page title
        if (!$this->pageTitle) {
            $this->pageTitle = 'backend::lang.page.untitled';
        }

        // Load the view
        if (!$this->suppressView && $result === null) {
            return $this->makeView($actionName);
        }

        return $this->makeViewContent($result);
    }
408676
public function execute( $action = null, $params = array() ) 
	{
		$this->set_language_alias( $action );
		
		// reset the response
		$this->response = null;
		$this->output = null;
		
		// fix notice
		$return = null;
		 
		if ( is_null( $action ) ) 
		{
			$action = static::$_default_action;
		}
		
		// capture all output made in the controller
		ob_start();
		
		// run wake event
		if ( method_exists( $this, 'wake' ) ) 
		{
			$return = call_user_func_array( array( $this, 'wake' ), $params );
		}
		
		// do we already have an resposne from the wake event?
		if ( !$return instanceof CCResponse )
		{
			// check if we got a custom action handler
			if ( !is_null( static::$_action_handler ) ) 
			{
				$return = call_user_func( array( $this, static::$_action_handler ), $action, $params );
			} 
			// normal action
			else
			{
				// check if the action exists
				if ( method_exists( $this, static::$_action_prefix.$action ) )
				{
					$return = call_user_func_array( array( $this, static::$_action_prefix.$action ), $params );
				}
				else 
				{
					$return = CCResponse::error( 404 );
				}
			}
		}
		
		// get the output
		$this->output = ob_get_clean();
		
		// do we got a response now?
		if ( $return instanceof CCResponse ) 
		{
			$this->response = $return;
		}
		// or a string
		elseif ( !empty( $return ) && is_string( $return ) )
		{
			$this->response = $this->_respond( $return );
		}
		
		// do we got a valid response if not use controller output		
		if ( !$this->response instanceof CCResponse ) 
		{
			$this->response = $this->_respond( $this->output );
		}
		
		// run sleep event
		if ( method_exists( $this, 'sleep' ) ) 
		{
			call_user_func_array( array( $this, 'sleep' ), $params );
		}
		
		// return thaaaaat
		return $this->response;
	}
349005
private function makeObjectAndRunMethod(
        string $className,
        string $domain,
        string $action,
        array $realParameters
    ): void
    {
        if (!$this->lHelper->isActionEnabled($className, $action)) {
            $action = "help";
        }

        $this->container->make($className)
            ->{$action}
            (...($this->lHelper->getReCastedParameters($className, $domain, $action, $realParameters)));
    }