开发者

PHP call stack question

I'm working on a framework that has a function invokeView() in the controller. As of now, this basically calls include on a $target php class which in turn displays a smarty template. I'd like the $target class to have access to a $response object which is created inside of the controller (the same place that calls the $target page).

Instead of having the $target page grab the $response object from a global area (like session storage), I'd like to pass it in to the $target class, maybe by having a function on the $target object like d开发者_运维百科isplay($response). It seems like if I did something like that, the call stack would just keep growing and growing, which would not be good.

Does what I'm saying make any sense? If so, what makes more sense, passing the $response in or grabbing it from the Session?

Thanks!


No, it does not make sense and should not be an issue. PHP has a function nesting limit that takes care of too deeply nested code calls anyway :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜