者局部替换成你在配置中设置的字符串。
用法
创建一个你定义的敏感词配置文件
/home/kerkness/kohana/application/config/censor.php
return array( 'words' => array( 'Codeigniter', 'Zend', 'CakePHP', 'Yii', ), );
echo Text::censor('I used CakePHP and Zend but I likeYiis', Kohana::$config->load('censor')->words);输出结果:
I used ####### and #### but I like###s
echo Text::censor('I used CakePHP and Zend but I likeYiis', Kohana::$config->load('censor')->words,'Kohana');
I used Kohana and Kohana but I likeKohanas
echo Text::censor('I used CakePHP and Zend but I likeYiis', Kohana::$config->load('censor')->words,'*',FALSE);输出结果:
I used ******* and **** but I likeYiis