/**
  *    _module_router
  *
  *    this method instantiates modules and calls the method that was defined when the route was registered
  *
  * @access    private
  * @param   string  $module_name
  * @param   string  $method
  * @return    EED_Module | NULL
  */
 private function _module_router($module_name, $method)
 {
     // instantiate module class
     $module = EE_Module_Request_Router::module_factory($module_name);
     if ($module instanceof EED_Module) {
         // and call whatever action the route was for
         call_user_func(array($module, $method), $this->WP_Query);
     }
     return $module;
 }
Exemplo n.º 2
0
 /**
  * @param mixed string | EED_Module $module
  */
 public function add_module($module)
 {
     if ($module instanceof EED_Module) {
         $module_class = get_class($module);
         $this->modules->{$module_class} = $module;
     } else {
         if (!class_exists('EE_Module_Request_Router')) {
             $this->load_core('Module_Request_Router');
         }
         $this->modules->{$module} = EE_Module_Request_Router::module_factory($module);
     }
 }
 /**
  *    _module_router
  *
  *    this method instantiates modules and calls the method that was defined when the route was registered
  *
  * @access    private
  * @param   string  $module_name
  * @param   string  $method
  * @return    EED_Module | NULL
  */
 private function _module_router($module_name, $method)
 {
     // instantiate module class
     $module = EE_Module_Request_Router::module_factory($module_name);
     if ($module instanceof EED_Module) {
         // and call whatever action the route was for
         try {
             call_user_func(array($module, $method), $this->WP_Query);
         } catch (EE_Error $e) {
             $e->get_error();
             return NULL;
         }
     }
     return $module;
 }