CakePHP:使用Text helper剥离HTML?

iam*_*esy 2 php cakephp helper

我正在使用文本助手的truncate方法,这样做意味着正在呈现文本中包含的任何html.有没有设置文本助手去除html标签?

           echo $text->truncate(    
                $project['Project']['description'], 
                250,   
                array(
                    'ending' => '...', 
                    'exact' => false
                )
            );
Run Code Online (Sandbox Code Playgroud)

是否有类似stripLinks方法的修改?

谢谢,

Jonesy

dog*_*c69 5

echo $text->truncate(    
            $project['Project']['description'], 
            250,   
            array(
                'ending' => '...', 
                'exact' => false,
                'html' => true
            )
        );
Run Code Online (Sandbox Code Playgroud)

这会使它尊重html结构.你可以随时使用strip_tags(),在蛋糕中使用php函数没有任何问题:)