XOOPS  2.6.0
Xmf\Highlighter Class Reference

Static Public Member Functions

static apply ($words, $body, $pre= '< strong >', $post= '</strong >')
 

Static Private Member Functions

static splitOnTag ($needle, $haystack, $pre, $post)
 

Detailed Description

Definition at line 26 of file Highlighter.php.

Member Function Documentation

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$wordswords to highlight
string$bodybody of html text to highlight
string$prestring to begin a highlight
string$poststring 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$needlestring to find
string$haystackhtml text to find needle in
string$preinsert before needle
string$postinsert after needle
Returns
string

Definition at line 64 of file Highlighter.php.


The documentation for this class was generated from the following file: