public function ElasticsearchController::page in Elasticsearch Connector 8.6
Same name and namespace in other branches
- 8.7 src/Controller/ElasticsearchController.php \Drupal\elasticsearch_connector\Controller\ElasticsearchController::page()
- 8 src/Controller/ElasticsearchController.php \Drupal\elasticsearch_connector\Controller\ElasticsearchController::page()
- 8.2 src/Controller/ElasticsearchController.php \Drupal\elasticsearch_connector\Controller\ElasticsearchController::page()
- 8.5 src/Controller/ElasticsearchController.php \Drupal\elasticsearch_connector\Controller\ElasticsearchController::page()
Displays information about an Elasticsearch Cluster.
Parameters
\Drupal\elasticsearch_connector\Entity\Cluster $elasticsearch_cluster: An instance of Cluster.
Return value
array An array suitable for drupal_render().
File
- src/
Controller/ ElasticsearchController.php, line 50
Class
- ElasticsearchController
- Provides route responses for elasticsearch clusters.
Namespace
Drupal\elasticsearch_connector\ControllerCode
public function page(Cluster $elasticsearch_cluster) {
// Build the Search API index information.
$render = [
'view' => [
'#theme' => 'elasticsearch_cluster',
'#cluster' => $elasticsearch_cluster,
],
];
// Check if the cluster is enabled and can be written to.
if ($elasticsearch_cluster->cluster_id) {
$render['form'] = $this
->formBuilder()
->getForm('Drupal\\elasticsearch_connector\\Form\\ClusterForm', $elasticsearch_cluster);
}
return $render;
}