yii 阅读 2493
Yii2 第10章 view中使用controller定义的变量

Yii2 第10章 view中使用controller定义的变量

2022-06-27 • lulubin

一、从 controller 传递值到 view 中

https://file.lulublog.cn/images/3/2022/08/hTZzPO75ycEIIsaYAeCm9lS5ey9LCC.png?sign=21698889a03cee453a6d66d3d1f4e182&t=6acd0400

https://file.lulublog.cn/images/3/2022/08/xcJNBEnCeAErx8L8rB8tXEIGZcT8ij.png?sign=ebf18ee2ad4c8dab8eb79bda80212e9a&t=6acd0400

二、在 controller 设置 view::params 属性的值

在 view 中访问

https://file.lulublog.cn/images/3/2022/08/JvgGVC4NP7VppSsu7y4chG5YuGV97N.png?sign=ef43ed4f54439cf32fd8239dfa7c5601&t=6acd0400

三、view::context 获取上下文

https://file.lulublog.cn/images/3/2022/08/VWt2Y5ppsKZIoKpM27yB518wTTb2Dk.png?sign=cef747a6e9e0732d01d4c29dbfb0819c&t=6acd0400

https://file.lulublog.cn/images/3/2022/08/YyIiLEZeMapZIlZy2eeeIaiEE2Qeaz.png?sign=403d625c43a913985be16986d0206dcb&t=6acd0400

打赏

×

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开微信扫一扫,即可进行扫码打赏哦