You are here

public function SearchController::redirectSearchPage in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 187
Contains \Drupal\search\Controller\SearchController.

Class

SearchController
Route controller for search.

Namespace

Drupal\search\Controller

Code

public function redirectSearchPage(SearchPageInterface $entity) {
  return $this
    ->redirect('search.view_' . $entity
    ->id());
}