SearchController::setAsDefault

public SearchController::setAsDefault(SearchPageInterface $search_page)

Sets the search page as the default.

Parameters

\Drupal\search\SearchPageInterface $search_page: The search page entity.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse A redirect to the search settings page.

File

core/modules/search/src/Controller/SearchController.php, line 229

Class

SearchController
Route controller for search.

Namespace

Drupal\search\Controller

Code

public function setAsDefault(SearchPageInterface $search_page) {
  // Set the default page to this search page.
  $this->searchPageRepository->setDefaultSearchPage($search_page);

  drupal_set_message($this->t('The default search page is now %label. Be sure to check the ordering of your search pages.', array('%label' => $search_page->label())));
  return $this->redirect('entity.search_page.collection');
}
doc_Drupal
2016-10-29 09:40:15
Comments
Leave a Comment

Please login to continue.