Class SearchForm
Standard basic search form which conducts a fulltext search on all SiteTree objects.
If multilingual content is enabled through the Translatable
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 Translatable::get_current_locale() when then
form is constructed.
- Object
-
ViewableData
implements
IteratorAggregate
-
RequestHandler
-
Form
-
SearchForm
Direct known subclasses
See: Use ModelController and SearchContext for a more generic search implementation based around DataObject
Located at sapphire/search/SearchForm.php
Methods summary
public static
|
|
public
|
#
__construct(
|
public
|
|
public
|
#
classesToSearch( mixed $classes )
Set the classes to search. Currently you can only choose from "SiteTree" and "File", but a future version might improve this. |
public
|
#
getResults( integer $pageLength = null, array $data = null )
Return dataObjectSet of the results using $_REQUEST to get info from form. Wraps around searchEngine(). |
protected
string
|
#
addStarsToKeywords( string $keywords )
Добавляет * в конец слов с учетом других значений boolean mode |
public
string
|
#
getSearchQuery( array $data = null )
Get the search query for display in a "You searched for ..." sentence. |
public
|
|
public
integer
|
Methods inherited from Form
Actions(),
Controller(),
FieldMap(),
Fields(),
FormAction(),
FormAttributes(),
FormEncType(),
FormHttpMethod(),
FormMethod(),
FormName(),
HiddenFields(),
Message(),
MessageType(),
Name(),
addErrorMessage(),
addExtraClass(),
buttonClicked(),
callfieldmethod(),
clearMessage(),
current_action(),
dataFieldByName(),
debug(),
defaultAction(),
disableDefaultAction(),
disableSecurityToken(),
disable_all_security_tokens(),
extraClass(),
forAjaxTemplate(),
formHtmlContent(),
getData(),
getExtraFields(),
getLegend(),
getMessageFromSession(),
getRecord(),
getRedirectToFormOnValidationError(),
getTemplate(),
getValidator(),
handleField(),
httpSubmission(),
loadDataFrom(),
makeReadonly(),
messageForForm(),
removeExtraClass(),
renderWithoutActionButton(),
resetField(),
resetValidation(),
saveInto(),
securityTokenEnabled(),
sessionMessage(),
setActions(),
setButtonClicked(),
setFields(),
setFormAction(),
setFormMethod(),
setHTMLID(),
setLegend(),
setMessage(),
setRedirectToFormOnValidationError(),
setTarget(),
setTemplate(),
setValidator(),
set_current_action(),
setupFormErrors(),
single_field_required(),
testAjaxSubmission(),
testSubmission(),
transform(),
transformTo(),
unsetActionByName(),
unsetAllActions(),
unsetDataFieldByName(),
unsetFieldFromTab(),
unsetValidator(),
validate()
Methods inherited from RequestHandler
allowedActions(),
checkAccessAction(),
getRequest(),
handleRequest(),
hasAction(),
httpError()
Methods inherited from ViewableData
ATT_val(),
BaseHref(),
CSSClasses(),
ColumnBreak(),
ColumnCalc(),
ColumnNumber(),
ColumnPad(),
ColumnPos(),
CurrentMember(),
CurrentPage(),
Debug(),
Even(),
EvenOdd(),
First(),
FirstLast(),
HasPerm(),
IsAjax(),
JS_val(),
Last(),
Me(),
Middle(),
MiddleString(),
Modulus(),
MultipleOf(),
Odd(),
Pos(),
RAW_val(),
SQL_val(),
ThemeDir(),
ThemeName(),
Top(),
TotalItems(),
XML_val(),
__get(),
__isset(),
__set(),
buildCastingCache(),
cachedCall(),
castingClass(),
castingHelper(),
castingHelperPair(),
castingObjectCreator(),
castingObjectCreatorPair(),
customise(),
defineMethods(),
escapeTypeForField(),
getField(),
getIterator(),
getSecurityID(),
getXMLValues(),
hasField(),
hasValue(),
i18nLocale(),
iteratorProperties(),
obj(),
renderWith(),
setCustomisedObj(),
setField()
Methods inherited from Object
__call(),
__toString(),
__wakeup(),
addMethodsFrom(),
addStaticVars(),
addWrapperMethod(),
add_extension(),
add_static_var(),
allMethodNames(),
cacheToFile(),
cacheToFileWithArgs(),
clearCache(),
combined_static(),
create(),
createMethod(),
create_from_string(),
exists(),
extInstance(),
extend(),
getCustomClass(),
getExtensionInstance(),
getExtensionInstances(),
get_extensions(),
get_static(),
hasExtension(),
hasMethod(),
has_extension(),
invokeWithExtensions(),
is_a(),
loadCache(),
parentClass(),
parse_class_spec(),
remove_extension(),
sanitiseCachename(),
saveCache(),
set_stat(),
set_static(),
set_uninherited(),
stat(),
strong_create(),
uninherited(),
uninherited_static(),
useCustomClass()
Magic methods summary
Properties summary
protected
integer
|
$pageLength |
#
$pageLength How many results are shown per page. Relies on pagination being implemented in the search results template. |
protected
array
|
$classesToSearch |
#
Classes to search |
Properties inherited from Form
$IncludeFormTag,
$actions,
$buttonClickedFunc,
$controller,
$current_action,
$extraClasses,
$fields,
$formMethod,
$hasDefaultAction,
$jsValidationIncluded,
$legend,
$message,
$messageType,
$name,
$record,
$redirectToFormOnValidationError,
$security,
$target,
$template,
$url_handlers,
$validator
Properties inherited from RequestHandler
$allowed_actions,
$brokenOnConstruct,
$request
Properties inherited from ViewableData
$casting,
$customisedObject,
$default_cast,
$failover,
$iteratorPos,
$iteratorTotalItems