php - 在php中访问控制器的私有变量
问题描述
我创建了一个控制器和一些视图:
Controller
Private $importantValues;
Public function1
Render view2
Public function2
Render view3
Public function3
Call function4
Private function4
save something in db
end controller
view1
call function1
View2
With post call function2
View3
With post call function3
为什么 $importantValues 只存在于 function1 和 function2 中?在其他功能中,它被重置。
解决方案
推荐阅读
- php - 致命错误:未捕获的错误:调用未定义的函数 mysqli 你能帮帮我吗
- sql - Oracle SQL - 使用选择生成聚合行
- angular - 尽管存在期望,但规范没有期望控制台错误
- python - Cython:将点索引分配给粗网格的最快方法
- ios - 如何在一个 tableView 上提供超过 2 个自定义单元格以进行聊天
- ruby-on-rails - Rails 嵌套 has_many 和附加上下文
- python - Excel 行的升序
- c - GCC 的 sqrt() 编译后如何工作?使用哪种root方法?牛顿-拉夫森?
- php - 无法从连接 API 获取连接
- android - 如何每隔一段时间刷新android标签片段?