class PanopolySearchController in Panopoly 8.2
Panopoly Search controller.
Hierarchy
- class \Drupal\panopoly_search\Controller\PanopolySearchController
Expanded class hierarchy of PanopolySearchController
File
- modules/
panopoly/ panopoly_search/ src/ Controller/ PanopolySearchController.php, line 12
Namespace
Drupal\panopoly_search\ControllerView source
class PanopolySearchController {
/**
* Controller to redirect to the search page.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* The request.
*
* @return array|\Symfony\Component\HttpFoundation\RedirectResponse
* The response.
*/
public function redirectToSearch(Request $request) {
$search_page_route = panopoly_search_page_route();
if (empty($search_page_route)) {
$build = [
'#markup' => t('Search is currently disabled'),
];
return $build;
}
$parameters = [];
if ($keys = $request
->get('keys')) {
$parameters['keys'] = $keys;
}
return new RedirectResponse(Url::fromRoute($search_page_route, $parameters, [
'absolute' => TRUE,
])
->toString());
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PanopolySearchController:: |
public | function | Controller to redirect to the search page. |