1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lack of Interest New Code Event Request

Discussion in 'Closed Suggestions' started by xf_phantom, Nov 28, 2013.

  1. xf_phantom

    xf_phantom Well-Known Member

    Could we get a new event, which will be fired here:
    Code:
      protected function _getValidatedController($controllerName, $action, XenForo_RouteMatch $routeMatch)
       {
         $newControllerName = XenForo_Application::resolveDynamicClass($controllerName, 'controller');
         if ($newControllerName)
         {
           $controller = new $newControllerName($this->_request, $this->_response, $routeMatch);
    XenForo_CodeEvent::fire('controller_create', array($this, $controller, &$action));
           if (method_exists($controller, 'action' . $action) && $this->_dependencies->allowControllerDispatch($controller, $action))
           {
             return $controller;
           }
         }
    
         return null;
       }
    This way, we could change the action name before it gets called.


    My problem is, that _getValidatedController will return null, if the method actionX doesn't exist and i can't do ANYTHING inside the controller, to change this behaviour (e.g. start a new reroute)

    PHP:
    $controller $this->_getValidatedController($controllerName$action$routeMatch);
           if (
    $controller)
           {
             try
             {
               try
               {
                 
    $controller->preDispatch($action$controllerName);
                 
    $controllerResponse $controller->{'action' $action}();
               }
               catch (
    XenForo_ControllerResponse_Exception $e)
               {
                 
    $controllerResponse $e->getControllerResponse();
               }

               
    $controller->postDispatch($controllerResponse$controllerName$action);
               
    $reroute $this->_handleControllerResponse($controllerResponse$controllerName$action);
             }
     
  2. xf_phantom

    xf_phantom Well-Known Member

Share This Page