Last active
June 5, 2023 12:02
-
-
Save rccc/cc6aa026ae0c3d01a487ad2068c35d10 to your computer and use it in GitHub Desktop.
Form responses must redirect to another location
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function search(int $page =1, Request $request, SessionInterface $session, SearchService $searchService) | |
{ | |
$searchType = null; | |
$result = null; | |
$queryList = []; | |
$tmp = []; | |
$result = $searchService->handleSearchRequest($request, $page); | |
$selection = $session->get('selection'); | |
if($result) | |
{ | |
if($searchService->getDisplay() == "grid") | |
{ | |
$template = 'search/result_grid.html.twig'; | |
} | |
else | |
{ | |
$template = 'search/result.html.twig'; | |
} | |
return $this->renderForm($template, [ | |
'result' => $result, | |
'total' => $result[0]['full_count'], | |
'page' => $page, | |
'selection' => $selection, | |
'searchService' => $searchService->toArray() | |
]); | |
} | |
return $this->redirectToRoute('index'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment