zoukankan      html  css  js  c++  java
  • [eZ publish] Url filter

    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.

  • 相关阅读:
    今日SGU 5.27
    今日SGU 5.26
    今日SGU 5.25
    软件工程总结作业
    个人作业——软件产品案例分析
    个人技术博客(α)
    结对作业二
    软工实践 二
    软工实践 一
    《面向对象程序设计》六 GUI
  • 原文地址:https://www.cnblogs.com/davidhhuan/p/1716929.html
Copyright © 2011-2022 走看看