1. Add the code to the /setttings/override/site.ini.append.php file

[URLTranslator]
Extensions[]
Extensions[]=myfilters

Filters[]
Filters[]=StripWords

 

That means we have a new extension "myfilters", and "stripwords.php" file containing the "StripWords" class.


2. Create a file called "stripwords.php" in "/extension/myfilters/urlfilters" directory. Note that, the file must be located in "urlfilters" directory! And in the file, there must contain code as below:
<?php
class StripWords
{
    function process($text, $languageObject, $caller)
    {
        //ex. code
        //return str_replace( "hell", "", $text );   
    }
}
?>

The filter class "StripWords" implements a method called "process"which has three parameters: the text to filter, the language object(eZContentLanguage) and the object which called the filter process.

相关文章:

  • 2021-05-30
  • 2022-03-05
  • 2021-12-14
  • 2021-06-09
  • 2021-09-24
  • 2022-02-09
  • 2021-11-28
  • 2022-12-23
猜你喜欢
  • 2021-10-25
  • 2021-12-12
  • 2021-06-29
  • 2022-12-23
  • 2021-09-30
  • 2021-09-09
  • 2021-11-08
相关资源
相似解决方案