Documentation

LgmsSearchBlock extends BlockBase
in package

Provides a block for a search bar specifically designed for LGMS.

This block generates a search input field that can be styled and configured differently based on the context it is used in. The context is determined by the 'type' property, which adjusts the CSS class applied to the search input for different styling opportunities.

Tags
Block

( id = "lgms_search_block", admin_label = @Translation("LGMS Search Bar"), category = @Translation("LGMS"), )

Table of Contents

Properties

$type  : string
The type of search bar, affecting its styling and placement.

Methods

build()  : array<string|int, mixed>
Builds and returns the renderable array for this block plugin.
setType()  : void
Sets the type of the search bar.

Properties

$type

The type of search bar, affecting its styling and placement.

private string $type

Methods

build()

Builds and returns the renderable array for this block plugin.

public build() : array<string|int, mixed>

This method is responsible for generating the search bar's HTML structure, along with any attached libraries or attributes. The appearance and behavior of the search bar can be influenced by the 'type' property.

Return values
array<string|int, mixed>

A renderable array representing the content of the block. This includes the search input field and any necessary libraries or attributes for functionality and styling.

setType()

Sets the type of the search bar.

public setType(string $type) : void

The type influences the CSS classes applied to the search bar, allowing for different styling based on where the search bar is used (e.g., dashboard or guides list).

Parameters
$type : string

The type of the search bar, determining its styling context.


        
On this page

Search results