CWP\Search\Extensions\SearchControllerExtension
Adds a search form and handling method to a {@link Controller} instance, using the configured CWP search engine
Synopsis
class SearchControllerExtension
extends Extension
{
- // members
- private static array $allowed_actions = ;
- private static integer $results_per_page = 10;
- private static bool $search_follow_suggestions = true;
- private static array $classes_to_search = ;
- // methods
- public void SearchForm()
- public SearchForm HeaderSearchForm()
- public DBHTMLText results()
- protected array getResultsTemplate()
Hierarchy
Extends
- SilverStripe\Core\Extension
Uses
- SilverStripe\Core\Config\Configurable
Members
private
- $allowed_actions
- $classes_to_search
—
array
Which classes should be queried when searching? - $results_per_page
—
int
How many search results should be shown per-page? - $search_follow_suggestions
—
CWP\Search\Extensions\bool
If spelling suggestions for searches are given, enable suggested searches to be followed immediately
Methods
protected
- getResultsTemplate() — Select the template to render search results with
public
- HeaderSearchForm() — Get search form with _header suffix
- SearchForm() — Site search form
- results() — Process and render search results.