Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
filterobject Class Reference

This is just a little object to define a phrase and some instructions for how to process it. More...

Public Member Functions

 __construct ($phrase, $hreftagbegin='< span class="highlight">', $hreftagend='</span >', $casesensitive=false, $fullmatch=false, $replacementphrase=null, $replacementcallback=null, array $replacementcallbackdata=null)
 Constructor.
 

Public Attributes

bool $casesensitive
 whether the match needs to be case sensitive.
 
bool $fullmatch
 whether to match complete words.
 
string $hreftagbegin
 HTML to insert before any match.
 
string $hreftagend
 HTML to insert after any match.
 
string $phrase
 this is the phrase that should be matched.
 
null callable $replacementcallback
 hold a replacement function to be called.
 
null array $replacementcallbackdata
 data to be passed to $replacementcallback.
 
null string $replacementphrase
 replacement text to go inside begin and end.
 
null string $workregexp = null
 once initialised, holds the regexp for matching this phrase.
 
null string $workreplacementphrase = null
 once initialised, holds the mangled HTML to replace the regexp with.
 

Detailed Description

This is just a little object to define a phrase and some instructions for how to process it.

Filters can create an array of these to pass to thelink filter_phrases()} function below.

Note that although the fields here are public, you almost certainly should never use that. All that is supported is contructing new instances of this class, and then passing an array of them to filter_phrases.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

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