Skip to content
Snippets Groups Projects
Commit 9eec5a35 authored by wodby's avatar wodby
Browse files

ISTWCMS-5127: updating services search

parent fb1d6f1c
No related branches found
No related tags found
3 merge requests!60ISTWCMS-6095 Update maxlength settings for title, text fields and link fields...,!25ISTWCMS-5779 Click update button under...,!8Feature/istwcms 5127 ebremner services blocks gui
......@@ -34,26 +34,28 @@ class ServiceSearchForm extends FormBase {
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param string|null $description
* The description for the input element.
* @param bool $use_placeholder
* Flag to user placeholder.
* @param string|null $placeholder
* The placeholder string.
* @param string|null $description
* The description for the input element.
*
* @return array
* The form structure.
*/
public function buildForm(array $form, FormStateInterface $form_state, string $description = NULL, string $placeholder = NULL): array {
public function buildForm(array $form, FormStateInterface $form_state, bool $use_placeholder = TRUE, string $placeholder = NULL, string $description = NULL): array {
// If there is no placeholder sent, then set it to
// search all services.
if (!$placeholder) {
if ($use_placeholder && $placeholder == NULL) {
$placeholder = 'Search within all services';
}
// The search input.
$form['search_input'] = [
'#type' => 'textfield',
'#placeholder' => $placeholder,
'#placeholder' => $use_placeholder ? $placeholder : NULL,
'#description' => $description ?? NULL,
'#required' => TRUE,
];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment