|
static | apply ($words, $body, $pre= '< strong >', $post= '</strong >') |
|
|
static | splitOnTag ($needle, $haystack, $pre, $post) |
|
Definition at line 26 of file Highlighter.php.
static Xmf\Highlighter::apply |
( |
|
$words, |
|
|
|
$body, |
|
|
|
$pre = '<strong>' , |
|
|
|
$post = '</strong>' |
|
) |
| |
|
static |
Apply highlight to words in body text
Surround occurances of words in body with pre in front and post behing. Considers only occurances of words outside of HTML tags.
- Parameters
-
mixed | $words | words to highlight |
string | $body | body of html text to highlight |
string | $pre | string to begin a highlight |
string | $post | string to end a highlight |
- Returns
- string highlighted body
Definition at line 41 of file Highlighter.php.
static Xmf\Highlighter::splitOnTag |
( |
|
$needle, |
|
|
|
$haystack, |
|
|
|
$pre, |
|
|
|
$post |
|
) |
| |
|
staticprivate |
find needle in between html tags and add highlighting
- Parameters
-
string | $needle | string to find |
string | $haystack | html text to find needle in |
string | $pre | insert before needle |
string | $post | insert after needle |
- Returns
- string
Definition at line 64 of file Highlighter.php.
The documentation for this class was generated from the following file: