/** * Sets a redirect messages and redirects to the given internal path * * @param int|bool $success * @param string $text * @param string|null $path * * @return \Symfony\Component\HttpFoundation\JsonResponse|\Symfony\Component\HttpFoundation\RedirectResponse */ public function setMessage($success, $text, $path = null) { $this->sessionHandler->set('redirect_message', ['success' => is_int($success) ? true : (bool) $success, 'text' => $text]); // If no path has been given, guess it automatically if ($path === null) { $path = $this->request->getModuleAndController(); } return $this->redirect->temporary($path); }
/** * @param string $menu * * @return int */ protected function selectMenuItem($menu) { if ($this->request->getArea() !== Core\Controller\AreaEnum::AREA_ADMIN) { $in = [$this->request->getQuery(), $this->request->getUriWithoutPages(), $this->request->getFullPath(), $this->request->getModuleAndController(), $this->request->getModule()]; return $this->menuItemRepository->getLeftIdByUris($menu, $in); } return 0; }
private function appendControllerActionBreadcrumbs() { $serviceId = $this->getControllerServiceId(); if ($this->request->getController() !== 'index' && $this->container->has($serviceId)) { $this->append($this->translator->t($this->request->getModule(), $this->getControllerIndexActionTitle()), $this->request->getModuleAndController()); } if ($this->request->getAction() !== 'index') { $this->append($this->translator->t($this->request->getModule(), $this->getControllerActionTitle()), $this->request->getFullPath()); } }
/** * @param string|null $moduleConfirmUrl * @param string|null $moduleIndexUrl * * @return array */ private function generateDefaultConfirmationBoxUris($moduleConfirmUrl, $moduleIndexUrl) { if ($moduleConfirmUrl === null) { $moduleConfirmUrl = $this->request->getFullPath(); } if ($moduleIndexUrl === null) { $moduleIndexUrl = $this->request->getModuleAndController(); } return [$moduleConfirmUrl, $moduleIndexUrl]; }