Re: OO parent/child relationship

From: Date: Sun, 05 Oct 2003 23:59:59 +0000
Subject: Re: OO parent/child relationship
References: 1 2 3 4 5 6 7 8  Groups: php.general 
Request: Send a blank email to php-general+get-165113@lists.php.net to get a copy of this message
Jeremy Johnstone wrote:
I would have to see your code That can be arranged.
Ill email you offlist.
, but maybe you don't need to be passing the references your doing. Why does your Smarty class need to access the database? Why does your Smarty class need a reference to the user management class inside it? Currently the templates dictate, how a page is laid out.
So I made a smarty plugin for that, which need access to the database, and user management to determine who gets what.
Personally, I see your user class being the only one which needs to access either one. Your user class should have am instance of both because your user class should be what pulls the data from the database, and then pushes it to the Smarty class for display. Maybe I am way off here, but essentially that is how it should be done IMHO. A redesign is probably in order.


« previous php.general (#165113) next »