Cakephp 视图中的安全和清理
我有一堆数据从控制器传递到视图。有没有一种快速的方法来获取从控制器传递的所有数据,例如在 AppController beforeRender 中,并对这些数据执行 sanitize->html ?
I have a bunch of data getting passed from controllers to views. Is there a quick way to grab all the data being passed from the controllers, like in AppController beforeRender and do a sanitize->html on that data?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
快速方法:模型中的
App::import('Sanitize');
并清理 beforeSave 中的所有内容Cake Cookbook 建议采用不同的方法:
Quick way:
App::import('Sanitize');
in the model and sanitize everything in beforeSaveCake cookbook advises a different way though: