VuFind API Documentation

Highlight extends Highlight
in package

Highlight view helper

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Table of Contents

$endTag  : string
End tag for highlighting
$startTag  : string
Start tag for highlighting
__construct()  : mixed
Constructor
__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

__construct()

Constructor

public __construct() : mixed
Return values
mixed

__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

Search results