/** * put your comment there... * */ public function _pointDelegated() { # Get ajax action $ajaxAction = current_filter(); # Remove wordpress ajax action prefix added to the hook name $name = substr($ajaxAction, strlen('wp_ajax_')); # Get endpoint config $endPointConfig =& $this->endPointsConfig[$name]; # Route $router = new CJTServicesHTTPRequestRouter($this->config['requestParams']); $router->getRoute($endPointConfig['route']); # Get Controller $this->controller =& $this->getControllerFactory()->getController(array_merge($this->config, $endPointConfig)); # Dispatch $this->controller->dispatch($endPointConfig['route']['action']); # Output echo $this->controller->getResponse(); # Exit die; }
/** * put your comment there... * */ public function _pageLoad() { # Get current hook slug $hookSlug = substr(current_filter(), strlen('load-')); # Get menu associated to current request hook slug $menu =& $this->menus[$hookSlug]; $menuConfig =& $menu['config']; # Get request route $router = new CJTServicesHTTPRequestRouter($this->config['requestParams']); $router->getRoute($menuConfig['route']); # Get controller $this->controller =& $this->getControllerFactory()->getController(array_merge($this->config, $menuConfig)); # Dispatch call $this->controller->dispatch($menuConfig['route']['action']); }