Closed David3310273 closed 6 years ago
在action中 return $this->display('view', ['aa'=>1,'bb'=>2]);
然后在view.tpl中 可以通过 <?=$PRM['aa']?>
获取
PRM的名称也可以在config.php 中 配置paramsKey
参数有两种用法
<?=$PRM['aa']?>
会自动做反xss注入保护
<?=$PRM->aa?>
则返回原始数据
多层数组数据也一样 具体参考http://www.billge.cc/#view-xss
为什么不再直接extract($this->params)
了?
如果这样 那就不具备 反xss的功能了 现在的页面渲染是可以不依赖开发习惯 完全屏蔽xss注入的
好的,谢谢
如果按照新版的配置
'paramsType'] => 'one'
,该怎样用display在视图中绑定参数?