Welcome Guest, Not a member yet? Register   Sign In
PHP objects
#4

[eluser]ndriana[/eluser]
Thank you for the replies.
I understand that I should not but I'd prefer if I can't.

WanWizard> Jamie’s blog is really a good idea.

The only problem is the "require once" at the top of the file. It is a bad habit as I will have more and more models. It might be better to create libraries.

Edit: the following idea fails
Another idea that came to me after reading that blog is also to make all the class members protected, extend the class with handlers. And only the base class will be passed to the View. And the derived will be used in the Controller.
I can't access to protected properties outer the subclass. But if I make it public then the same problem remains.
Aggregation won't work either.
I guess the solution is that blog or make a copy of the data to a variable and pass that to the View.
Or the least expensive is to not think about it a be careful.


Messages In This Thread
PHP objects - by El Forum - 09-22-2012, 03:53 PM
PHP objects - by El Forum - 09-22-2012, 04:28 PM
PHP objects - by El Forum - 09-22-2012, 04:37 PM
PHP objects - by El Forum - 09-22-2012, 05:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB