HTMLPurify in Codeigniter 4 |
Hello all
I'm trying to use HTMLPurify from this : htmlpurifier.org but it keeps getting error : Here when I useit in my traits: PHP Code: use ThirdParty\Purifier\Purifier; Here is my Purify.php located in App\ThirdParty\HTMLPurifier PHP Code: <?php The error : Quote:Quote:Class 'ThirdParty\Purifier\HTMLPurifier_Config' not foundAPPPATH\ThirdParty\HtmlPurifier\Purifier.php at line 11 It seems like the Purifier.php does not load HTMLPurifier.auto.php. How can I use this library in Codeigniter 4 ? Thanks in advance and Happy New Year
When you call the class "$config = HTMLPurifier_Config::createDefault();" it is called in the "namespace ThirdParty\Purifier;"
HTML Purifier library classes do not have "ThirdParty\Purifier" namespace. Add a backslash before the class name. This will take the class out of the current namespace into the global namespace. $config = \HTMLPurifier_Config::createDefault();
|
Welcome Guest, Not a member yet? Register Sign In |