SilverStripe\CMS\Search\SearchForm
Standard basic search form which conducts a fulltext search on all {@link SiteTree} objects.
If multilingual content is enabled through the extension,
only pages the currently set language on the holder for this searchform are found.
The language is set through a hidden field in the form, which is prepoluated
with when then form is constructed.
Synopsis
class SearchForm
extends Form
{
- // members
- protected integer $pageLength = 10;
- protected array $classesToSearch = ;
- private static array $casting = ;
- // methods
- public void __construct()
- public void classesToSearch()
- public array getClassesToSearch()
- public SS_List getResults()
- protected void addStarsToKeywords()
- public string getSearchQuery()
- public void setPageLength()
- public int getPageLength()
Hierarchy
Extends
- SilverStripe\Forms\Form
Members
private
- $casting
protected
- $classesToSearch
—
array
Classes to search - $pageLength
—
int
How many results are shown per page.
Methods
protected
public
- __construct()
- classesToSearch() — Set the classes to search.
- getClassesToSearch() — Get the classes to search
- getPageLength()
- getResults() — Return dataObjectSet of the results using current request to get info from form.
- getSearchQuery() — Get the search query for display in a "You searched for ..." sentence.
- setPageLength() — Set the maximum number of records shown on each page.