class SearchViewRoute in Google Search Appliance 8
Class DynamicRoute.
Hierarchy
- class \Drupal\google_appliance\Routing\SearchViewRoute
Expanded class hierarchy of SearchViewRoute
7 files declare their use of SearchViewRoute
- google_appliance.module in ./
google_appliance.module - Google Appliance module file.
- ResultSet.php in src/
SearchResults/ ResultSet.php - SearchBlockTest.php in tests/
src/ Functional/ SearchBlockTest.php - SearchForm.php in src/
Form/ SearchForm.php - SearchPageTest.php in tests/
src/ Functional/ SearchPageTest.php
File
- src/
Routing/ SearchViewRoute.php, line 11
Namespace
Drupal\google_appliance\RoutingView source
class SearchViewRoute {
const ROUTE_NAME = 'google_appliance.search_view';
/**
* Module settings.
*
* @var \Drupal\Core\Config\ImmutableConfig
*/
protected $settings;
/**
* SearchViewRoute constructor.
*
* @todo: Proper D.I.
*/
public function __construct() {
$this->settings = Drupal::configFactory()
->get('google_appliance.settings');
}
/**
* Get route dynamically from system settings.
*/
public function getRoute() {
$gsaDisplaySettings = $this->settings
->get('display_settings');
$drupalPath = $gsaDisplaySettings['drupal_path'];
$title = $gsaDisplaySettings['search_title'];
if ($drupalPath === NULL) {
return NULL;
}
$routes[self::ROUTE_NAME] = new Route('/' . $drupalPath . '/{search_query}/{result_sort}', [
'_title' => $title,
'_controller' => '\\Drupal\\google_appliance\\Controller\\SearchViewController::get',
'search_query' => '',
'result_sort' => '',
], [
'_permission' => 'access google appliance content',
]);
return $routes;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SearchViewRoute:: |
protected | property | Module settings. | |
SearchViewRoute:: |
public | function | Get route dynamically from system settings. | |
SearchViewRoute:: |
constant | |||
SearchViewRoute:: |
public | function | SearchViewRoute constructor. |