Drupal 8  8.0.2
SearchController Class Reference
Inheritance diagram for SearchController:

Public Member Functions

 __construct (SearchPageRepositoryInterface $search_page_repository, LoggerInterface $logger, RendererInterface $renderer)
 
 view (Request $request, SearchPageInterface $entity)
 
 searchHelp (SearchPageInterface $entity)
 
 redirectSearchPage (SearchPageInterface $entity)
 
 editTitle (SearchPageInterface $search_page)
 
 performOperation (SearchPageInterface $search_page, $op)
 
 setAsDefault (SearchPageInterface $search_page)
 

Static Public Member Functions

static create (ContainerInterface $container)
 

Protected Attributes

 $searchPageRepository
 
 $logger
 
 $renderer
 

Detailed Description

Route controller for search.

Constructor & Destructor Documentation

__construct ( SearchPageRepositoryInterface  $search_page_repository,
LoggerInterface  $logger,
RendererInterface  $renderer 
)

Constructs a new search controller.

Parameters
\Drupal\search\SearchPageRepositoryInterface$search_page_repositoryThe search page repository.
\Psr\Log\LoggerInterface$loggerA logger instance.
\Drupal\Core\Render\RendererInterface$rendererThe renderer.

References Drupal\logger().

Here is the call graph for this function:

Member Function Documentation

static create ( ContainerInterface  $container)
static

{}

editTitle ( SearchPageInterface  $search_page)

Route title callback.

Parameters
\Drupal\search\SearchPageInterface$search_pageThe search page entity.
Returns
string The title for the search page edit form.

References EntityInterface\label(), and t().

Here is the call graph for this function:

performOperation ( SearchPageInterface  $search_page,
  $op 
)

Performs an operation on the search page entity.

Parameters
\Drupal\search\SearchPageInterface$search_pageThe search page entity.
string$opThe operation to perform, usually 'enable' or 'disable'.
Returns
A redirect back to the search settings page.

References EntityInterface\label(), EntityInterface\save(), t(), and EntityInterface\urlInfo().

Here is the call graph for this function:

redirectSearchPage ( SearchPageInterface  $entity)

Redirects to a search page.

This is used to redirect from /search to the default search page.

Parameters
\Drupal\search\SearchPageInterface$entityThe search page entity.
Returns
A redirect to the search page.

References EntityInterface\id().

Here is the call graph for this function:

searchHelp ( SearchPageInterface  $entity)

Creates a render array for the search help page.

Parameters
\Symfony\Component\HttpFoundation\Request$requestThe request object.
\Drupal\search\SearchPageInterface$entityThe search page entity.
Returns
array The search help page.

References SearchPageInterface\getPlugin().

Here is the call graph for this function:

setAsDefault ( SearchPageInterface  $search_page)

Sets the search page as the default.

Parameters
\Drupal\search\SearchPageInterface$search_pageThe search page entity.
Returns
A redirect to the search settings page.

References EntityInterface\label(), and t().

Here is the call graph for this function:

view ( Request  $request,
SearchPageInterface  $entity 
)

Creates a render array for the search page.

Parameters
\Symfony\Component\HttpFoundation\Request$requestThe request object.
\Drupal\search\SearchPageInterface$entityThe search page entity.
Returns
array The search form and search results build array.

References Drupal\config(), SearchPageInterface\getPlugin(), EntityInterface\label(), Drupal\logger(), and t().

Here is the call graph for this function:


The documentation for this class was generated from the following file: