|
static | apply ($words, $body, $pre='< mark >', $post='</mark >') |
|
|
static | splitOnTag ($needle, $haystack, $pre, $post) |
|
◆ apply()
static apply |
( |
|
$words, |
|
|
|
$body, |
|
|
|
$pre = '<mark>' , |
|
|
|
$post = '</mark>' |
|
) |
| |
|
static |
Apply highlight to words in body text
Surround occurrences of words in body with pre in front and post behind. Considers only occurrences of words outside of HTML tags.
- Paramètres
-
string | string[] | $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 |
- Renvoie
- string highlighted body
◆ splitOnTag()
static splitOnTag |
( |
|
$needle, |
|
|
|
$haystack, |
|
|
|
$pre, |
|
|
|
$post |
|
) |
| |
|
staticprotected |
find needle in between html tags and add highlighting
- Paramètres
-
string | $needle | string to find |
string | $haystack | html text to find needle in |
string | $pre | insert before needle |
string | $post | insert after needle |
- Renvoie
- mixed return from preg_replace_callback()
◆ ENCODING
La documentation de cette classe a été générée à partir du fichier suivant :
- XoopsCore25-2.5.11-Beta1/htdocs/class/libraries/vendor/xoops/xmf/src/Highlighter.php