silverstripe-docsviewer/code/forms/DocumentationSearchForm.php
Will Rossiter 52733d6ebf Add support for [CHILDREN] shortcode
This allows you to build up dynamic listing pages much better.
2014-09-19 23:29:22 +12:00

23 lines
633 B
PHP

<?php
class DocumentationSearchForm extends Form {
public function __construct($controller) {
$fields = new FieldList(
TextField::create('q', _t('DocumentationViewer.SEARCH', 'Search'), '')
->setAttribute('placeholder', _t('DocumentationViewer.SEARCH', 'Search'))
);
$actions = new FieldList(
new FormAction('results', _t('DocumentationViewer.SEARCH', 'Search'))
);
parent::__construct($controller, 'DocumentationSearchForm', $fields, $actions);
$this->disableSecurityToken();
$this->setFormMethod('GET');
$this->setFormAction($controller->Link('results'));
$this->addExtraClass('search');
}
}