mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
FIX 'Search' text in default search form should be a placeholder
This commit is contained in:
parent
cc938ee26c
commit
35c3a8c68d
@ -26,17 +26,18 @@ class ContentControllerSearchExtension extends Extension
|
||||
*/
|
||||
public function SearchForm()
|
||||
{
|
||||
$searchText = _t('SilverStripe\\CMS\\Search\\SearchForm.SEARCH', 'Search');
|
||||
|
||||
$searchText = '';
|
||||
if ($this->owner->getRequest() && $this->owner->getRequest()->getVar('Search')) {
|
||||
$searchText = $this->owner->getRequest()->getVar('Search');
|
||||
}
|
||||
|
||||
$fields = new FieldList(
|
||||
new TextField('Search', false, $searchText)
|
||||
$placeholder = _t('SilverStripe\\CMS\\Search\\SearchForm.SEARCH', 'Search');
|
||||
$fields = FieldList::create(
|
||||
TextField::create('Search', false, $searchText)
|
||||
->setAttribute('placeholder', $placeholder)
|
||||
);
|
||||
$actions = new FieldList(
|
||||
new FormAction('results', _t('SilverStripe\\CMS\\Search\\SearchForm.GO', 'Go'))
|
||||
$actions = FieldList::create(
|
||||
FormAction::create('results', _t('SilverStripe\\CMS\\Search\\SearchForm.GO', 'Go'))
|
||||
);
|
||||
/** @skipUpgrade */
|
||||
$form = SearchForm::create($this->owner, 'SearchForm', $fields, $actions);
|
||||
|
Loading…
x
Reference in New Issue
Block a user