You are here

public function FederatedSearchPageFormBlock::build in Search API Federated Solr 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/Block/FederatedSearchPageFormBlock.php \Drupal\search_api_federated_solr\Plugin\Block\FederatedSearchPageFormBlock::build()
  2. 8.2 src/Plugin/Block/FederatedSearchPageFormBlock.php \Drupal\search_api_federated_solr\Plugin\Block\FederatedSearchPageFormBlock::build()
  3. 4.x src/Plugin/Block/FederatedSearchPageFormBlock.php \Drupal\search_api_federated_solr\Plugin\Block\FederatedSearchPageFormBlock::build()

Builds and returns the renderable array for this block plugin.

If a block should not be rendered because it has no content, then this method must also ensure to return no content: it must then only return an empty array, or an empty array with #cache set (with cacheability metadata indicating the circumstances for it being empty).

Return value

array A renderable array representing the content of the block.

Overrides BlockPluginInterface::build

See also

\Drupal\block\BlockViewBuilder

File

src/Plugin/Block/FederatedSearchPageFormBlock.php, line 22

Class

FederatedSearchPageFormBlock
Provides a "Federated Search Page Form" block.

Namespace

Drupal\search_api_federated_solr\Plugin\Block

Code

public function build() {
  $build = [];
  $build['container']['form'] = \Drupal::formBuilder()
    ->getForm('Drupal\\search_api_federated_solr\\Form\\FederatedSearchPageBlockForm');
  return $build;
}