Highlight
extends AbstractHelper
in package
Highlight view helper
Tags
Table of Contents
- $endTag : string
- End tag for highlighting
- $startTag : string
- Start tag for highlighting
- __invoke() : string
- Adds a span tag with class "highlight" around a specific phrase for highlighting
Properties
$endTag
End tag for highlighting
protected
string
$endTag
= '</span>'
$startTag
Start tag for highlighting
protected
string
$startTag
= '<span class="highlight">'
Methods
__invoke()
Adds a span tag with class "highlight" around a specific phrase for highlighting
public
__invoke(string $haystack[, mixed $needle = null ][, bool $clear = false ][, bool $escape = true ]) : string
Parameters
- $haystack : string
-
String to highlight
- $needle : mixed = null
-
Array of words to highlight (null for none)
- $clear : bool = false
-
Should we dehighlight (true) rather than highlight (false)?
- $escape : bool = true
-
Should we HTML encode the results?
Return values
string —Highlighted, HTML encoded string