mchat = $mchat; $this->request = $request; } /** * Controller for mChat * * @param $page The page to render, one of custom|archive|rules|whois * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object */ public function page($page) { return call_user_func(array($this->mchat, 'page_' . $page)); } /** * Controller for mChat actions called with Ajax requests * * @param $action The action to perform, one of add|edit|del|clean|refresh|whois * @return A Symfony JsonResponse object */ public function action($action) { if (!$this->request->is_ajax()) { throw new \phpbb\exception\http_exception(403, 'NO_AUTH_OPERATION'); } $data = call_user_func(array($this->mchat, 'action_' . $action)); return new JsonResponse($data); } }