类变量问题 [英] Class variable problem

查看:62
本文介绍了类变量问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我有这个班级 http:/ /pastebin.com/807571 ,我在

__construct上设置了一些变量。原来我设置$ total_?调用函数

showLayout()时的变量。我知道pastebin有问题,所以如果你不能获得代码,我会在我自己的服务器上以纯文本形式上传。

这个函数叫做来自页面对象,从

控制器调用等等。

这样做意味着在showLayout()期间设置的所有变量

函数,设置为null,下次我打开对象。

然后我就像现在一样设置它,我设置所有调用变量doring

__construct,这工作正常。

但现在的问题是,没有添加从showLayout()函数添加到类变量

的最后一个值。


这是PHP5中的错误还是我在这里做了一些非常错误的事情?


祝你好运,tatsudoshi

解决方案

total_?调用函数

showLayout()时的变量。我知道pastebin有问题,所以如果你不能获得代码,我会在我自己的服务器上以纯文本形式上传。

这个函数叫做来自页面对象,从

控制器调用等等。

这样做意味着在showLayout()期间设置的所有变量

函数,设置为null,下次我打开对象。

然后我就像现在一样设置它,我设置所有调用变量doring

__construct,这工作正常。

但现在的问题是,没有添加从showLayout()函数添加到类变量

的最后一个值。


这是PHP5中的错误还是我在这里做了一些非常错误的事情?


祝你好运,tatsudoshi


我已在 http:// www上传课程.criion.net / class.Kurv.php.txt

tatsudoshi写道:


您好,


我有这个班级 http://pastebin.com/807571 ,我在其中设置了一些变量

__construct 。原来我设置了


Hello,

I have this class http://pastebin.com/807571, where I set some variables on
__construct. Originaly I set the $total_? variables when the function
showLayout() was called. I know pastebin is having problems, so if you can''t
get the code, I will upload it in plain text on my own server.
This function is called from a page object, which is called from a
controller and so on.
Doing it this way meant that all variables set during the showLayout()
function, were set to null, next time I opened the object.
Then I set it up like it is now, where I set all call variables doring
__construct and this worked fine.
But now the problem is, that the last values added to the class variables
from the showLayout() function are not added.

Is this a bug in PHP5 or am I doing something terribly wrong here?

Best regards, tatsudoshi

解决方案

total_? variables when the function
showLayout() was called. I know pastebin is having problems, so if you can''t
get the code, I will upload it in plain text on my own server.
This function is called from a page object, which is called from a
controller and so on.
Doing it this way meant that all variables set during the showLayout()
function, were set to null, next time I opened the object.
Then I set it up like it is now, where I set all call variables doring
__construct and this worked fine.
But now the problem is, that the last values added to the class variables
from the showLayout() function are not added.

Is this a bug in PHP5 or am I doing something terribly wrong here?

Best regards, tatsudoshi


I have uploaded the class at http://www.criion.net/class.Kurv.php.txt


tatsudoshi wrote:

Hello,

I have this class http://pastebin.com/807571, where I set some variables on
__construct. Originaly I set the


这篇关于类变量问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆