Lack of interest New Code Event Request

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

xf_phantom

Well-known member
Could we get a new event, which will be fired here:
Rich (BB 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);
         }
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.

Similar threads

Replies
0
Views
367
R
Replies
1
Views
1K
Top Bottom