【发布时间】:2015-07-20 04:40:45
【问题描述】:
在视图 phtml 文件中访问本地函数中的变量时,我得到了这个流行的错误
Using $this when not in object context
我想知道有什么方法可以批量复制Controller中定义的ViewModel的Variables容器数据结构中的所有变量和对象,作为要查看的局部变量和对象,以便我可以在局部函数中使用它们?
换句话说,像 someCreateVariablesFromViewModelArray 方法在 phtml 中调用。因为我在 Zend Framework 2 的 ViewModel 变量容器数组中有很多数据。
【问题讨论】:
标签: php zend-framework2