Skip to content
Snippets Groups Projects
Commit 767438d8 authored by Kristof De Jaeger's avatar Kristof De Jaeger
Browse files

Get default value from request.

parent 47042a31
Branches 7.x-1.x
Tags 7.x-1.7
No related merge requests found
......@@ -76,12 +76,20 @@ class SearchApiPageBlockForm extends FormBase {
'#value' => $search_api_page->id(),
);
$default_value = '';
if (isset($args['keys'])) {
$default_value = $args['keys'];
}
elseif ($search_value = $this->getRequest()->get('keys')) {
$default_value = $search_value;
}
$form['keys'] = array(
'#type' => 'search',
'#title' => $this->t('Search'),
'#title_display' => 'invisible',
'#size' => 15,
'#default_value' => isset($args['keys']) ? $args['keys'] : '',
'#default_value' => $default_value,
'#attributes' => array('title' => $this->t('Enter the terms you wish to search for.')),
);
......
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