dispatch($event, TaskInitEvent::INIT_EVENT); return $this->render('@Core/task/task_admin/index.html.twig', [ 'pager' => $event->getTasks(), ]); } /** * @Route("/run/{task}", name="admin_task_run", methods={"GET"}) */ public function run( string $task, Request $request, EventDispatcherInterface $eventDispatcher ): Response { if (!$this->isCsrfTokenValid('task_run', $request->query->get('_token'))) { throw $this->createAccessDeniedException(); } $output = new BufferedOutput(); $event = new TaskRunRequestedEvent($task, $request->query, $output); $eventDispatcher->dispatch($event, TaskRunRequestedEvent::RUN_REQUEST_EVENT); $content = $output->fetch(); return $this->render('@Core/task/task_admin/run.html.twig', [ 'output' => $content, ]); } public function getSection(): string { return 'task'; } }