/** * Used to trigger registered controller actions */ public function trigger($method, $action, $params = null) { $method = $method === "*" ? "ANY" : Sanitize::toUpperCase($method); $action = $action === "*" ? "any" : Sanitize::toParam($action); if (!empty($this->_callbacks[$method][$action])) { $closure = $this->_callbacks[$method][$action]; $closure = $closure->bindTo($this); if (is_array($params)) { return call_user_func_array($closure, $params); } return call_user_func($closure, $params); } return false; }