public function ElasticsearchController::page in Elasticsearch Connector 8
Same name and namespace in other branches
- 8.7 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()
- 8.6 src/Controller/ElasticsearchController.php \Drupal\elasticsearch_connector\Controller\ElasticsearchController::page()
Displays information about an Elasticsearch Cluster.
Parameters
\Drupal\elasticsearch_connector\Entity\Cluster $cluster: An instance of Cluster.
Return value
array An array suitable for drupal_render().
File
- src/
Controller/ ElasticsearchController.php, line 29 - Contains \Drupal\elasticsearch_connector\Controller\ElasticsearchController.
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 = array(
'view' => array(
'#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;
}