public SearchPageRepository::setDefaultSearchPage(SearchPageInterface $search_page)
Sets a given search page as the default.
Parameters
\Drupal\search\SearchPageInterface $search_page: The search page entity.
Return value
static
Overrides SearchPageRepositoryInterface::setDefaultSearchPage
File
- core/modules/search/src/SearchPageRepository.php, line 98
Class
- SearchPageRepository
- Provides a repository for Search Page config entities.
Namespace
Drupal\search
Code
public function setDefaultSearchPage(SearchPageInterface $search_page) { $this->configFactory->getEditable('search.settings')->set('default_page', $search_page->id())->save(); $search_page->enable()->save(); }
Please login to continue.