转发给另一个控制器

@param string $controller
@param array $action
@param array $params
199916
protected function forward(string $controller, array $action = [], array $params = [])
    {
        return $this->dispatcher->forward([
            'handler' => $controller,
            'action' => $action,
            'params' => $params,
        ]);
    }
144024
function delete($action,$params = array(),$options = array()){
		$options["method"] = "DELETE";
		return $this->_doRequest($action,$params,$options);
	}
84304
public function call($action, $params = array()) {
		$time = 0.0;
		$response = new Client\Response($action, $this->directCall($action, $params, $time), $time);
		
		if(!$response->isOk()) {
			throw new Client\Exception\ActionFailed($response, "Action '".$action->name()."' failed: ".$response->getMessage());
		}
		
		switch($action->layout('output')) {
			case 'object':
				return new Client\ResourceInstance($this->client, $action, $response);
			
			case 'object_list':
				return new Client\ResourceInstanceList($this->client, $action, $response);
			
			default:
				return $response;
		}
	}
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;
	}
629959
public function perform($action, $table, $body = [], array $params = [])
    {
        $request = $this->db->getQueryBuilder()->perform($action, $table, $body, $params);
        $this->setRequest($request);

        return $this->send();
    }
961438
public function setAction(Controller $controller, $action = 'execute')
    {
        $this->controller = $controller;
        $this->action = $action;
    }
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;
    }
492758
public function defaultRoute($controller, $action = null, array $args = [])
    {
        $this->_defaultRoute = [
            'route' => implode('/', [$this->module->id, $controller, (empty($action)) ? 'index' : $action]),
            'args' => $args,
            'originalArgs' => $args,
        ];
    }
542358
protected function redirect($controller = null, $action = 'index', array $parameters = []) : Response
    {
        $host = 'http://'. $_SERVER['HTTP_HOST'];

        if ($controller === null) {

            // Apparently we want to redirect to homepage, so the host will be sufficient
            if ($action === 'index') {
                return $this->redirectUrl($host);
            }
            
            $controller = $this->getControllerName();
        }

        if ($action === 'index') {
            $action = '';
        }else{
            $action = '/' . $action;
        }

        return $this->redirectUrl(sprintf('%s/%s%s', $host, lcfirst($controller), $action), $parameters);
    }
328696
public function getPositionByName($controller, $action = null)
    {
        if ($action === null) {
            list($controller, $action) = explode('.', $controller);
        }
        return array_search("{$controller}.{$action}", $this->action_names);
    }
616675
public function buildUri(array $params = null, $controller = null, $action = null, $prepareUri = true)
    {
        $request = Container::getRequest();
        $request->setBaseUrl($this->getBaseUrl());
        if ($prepareUri) {
            [$params, $controller, $action] = $this->prepareUri($params, $controller, $action);
        } else {
            $params = $params ?? [];
            $controller = $controller ?? self::DEFAULT_CONTROLLER;
            $action = $action ?? self::DEFAULT_ACTION;
        }
        if (!is_array($params)) {
            $params = [];
        }
        if (isset($params['controller']) && ($controller === self::DEFAULT_CONTROLLER)) {
            $controller = $params['controller'];
            unset($params['controller']);
        }
        if (isset($params['action']) && ($action === self::DEFAULT_ACTION)) {
            $action = $params['action'];
            unset($params['action']);
        }
        $hasParams = count($params);
        $hasController = $controller != self::DEFAULT_CONTROLLER;
        $hasAction = $action != self::DEFAULT_ACTION;
        $uri  = $hasParams || $hasAction || $hasController ? '/' . $controller : '/';
        $uri .= $hasParams || $hasAction ? '/' . $action : '';
        foreach ($params as $key => $value) {
            $uri .= '/' . $key . '/' . $value;
        }
        
        $uri = '/' . ltrim(rtrim($request->getBaseUrl(), '/') . $uri, '/');
        return $uri;
    }
529115
function post($action,$params = array(),$options = array()){
		$options["method"] = "POST";
		return $this->_doRequest($action,$params,$options);
	}
575001
public function performAction($controller, $action) {
		// Replace namespace with directory separator
		$controllerFile = str_replace("\\", DIRECTORY_SEPARATOR, $controller);

		// Check if controller exists
		if ( false == is_file( $controllerLocation = APP . 'Controllers/' . $controllerFile . '.php' ) )
			throw new ControllerNotFoundException();

		// Include and init the controller
		$controllerClass = "\\Application\\Controllers\\{$controller}";
		$controllerObj = new $controllerClass($this);

		// Check if the action exists
		if ( 'Errors' != $controller && false == method_exists($controllerObj, $action.= "Action" ) )
			throw new ActionNotFoundException();
		// Check if the error display action exists
		elseif ( $controller == $this->defaultRoute['_controller'] && false == method_exists($controllerObj, $action = "display" . $action ) )
			throw new ErrorActionNotFoundException();

		// Run the action
		$data = $controllerObj->{$action}();

		// Data fetching
		if ( false === $controllerObj->__returnActionPerformed ):
			// Format returned data
			if ( false == is_array( $data ) )
				$data = (array) $data;

			// Start reflection for data loading
			$ref = new \ReflectionObject($controllerObj);
			$properties = $ref->getProperties(\ReflectionProperty::IS_PUBLIC);
			$controllerData = array();

			// Get public data
			foreach ( $properties as $property ):
				// Don't add internal variabels
				if ( '__returnActionPerformed' == $property->getName() )
					continue;

				// Add property to controller data
				$controllerData[$property->getName()] = $property->getValue($controllerObj);
			endforeach;

			// Merge data from controller and action
			$data = array_merge($controllerData, $data);
		endif;

		// Return the object
		return $data;
	}
1177136
protected function getCallParams($controller, $method, $params)
		{
			// variables
			$values     = is_array($params) ? $params : explode('/', $params);
			$ref        = new ReflectionMethod($controller, $method);
			$params     = $ref->getParameters();
			$args       = [];
	
			// map route segments to the method's parameters
			foreach ($params as /** @var \ReflectionParameter */ $param)
			{
				// parse signature [match, optional, type, name, default]
				preg_match('/<(required|optional)> (?:([\\\\a-z\d_]+) )?(?:\\$(\w+))(?: = (\S+))?/i', (string)$param, $matches);
	
				// assign untyped segments
				if ($matches[2] == null)
				{
					$args[$matches[3]] = array_shift($values);
				}
			}
	
			// append any remaining values
			return array_merge($args, $values);
		}
344054
public function handleAction($action, $actionParams)
    {
        $this->setView($action);
        $response = parent::handleAction($action, $actionParams);

        if ($response instanceof Response) {
            return $response;
        }

        if (is_string($response)) {
            $this->controllerView->content = $response;
        } elseif (isset($this->view)) {
            $this->controllerView->content = $this->view->render();
        }

        $this->response->setContent($this->controllerView->render());

        return $this->response;
    }
369187
public static function href($controller = null, string $action = null, array $params = null): string
    {
        return Application::route()->href($controller, $action, $params);
    }
300949
public function action(string $action, string $controller)
    {
        $this->options['actions'][strtolower($action)] = $controller;

        return $this;
    }