function SearchController::redirectSearchPage
Same name in other branches
- 8.9.x core/modules/search/src/Controller/SearchController.php \Drupal\search\Controller\SearchController::redirectSearchPage()
- 10 core/modules/search/src/Controller/SearchController.php \Drupal\search\Controller\SearchController::redirectSearchPage()
- 11.x core/modules/search/src/Controller/SearchController.php \Drupal\search\Controller\SearchController::redirectSearchPage()
Redirects to a search page.
This is used to redirect from /search to the default search page.
Parameters
\Drupal\search\SearchPageInterface $entity: The search page entity.
Return value
\Symfony\Component\HttpFoundation\RedirectResponse A redirect to the search page.
File
-
core/
modules/ search/ src/ Controller/ SearchController.php, line 177
Class
- SearchController
- Route controller for search.
Namespace
Drupal\search\ControllerCode
public function redirectSearchPage(SearchPageInterface $entity) {
return $this->redirect('search.view_' . $entity->id());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.