Andy Crain wrote:
This all seems like a perfect case for the singleton pattern. See
http://www.phppatterns.com/index.php/article/articleview/6/1/1/ and
http://www.phppatterns.com/index.php/article/articleview/75/1/1/
Andy
Im currently trying to wrap the brain around the Singleton Registry article.
t: Monday, October 06, 2003 2:07 AM
> To: Robert Cummings; Curt Zirzow
> Cc: PHP List
> Subject: Re: [PHP] OO parent/child relationship
>
> Aye. PHP already reserves function names prepended with __ as magic.
But
> really one could make this argument ad infinitum. If everyo
Aye. PHP already reserves function names prepended with __ as magic. But
really one could make this argument ad infinitum. If everyone wants to start
their variables with a *insert random character here*, "*grin*"
IMHO it's good advice to "prepend global vars with '__' or something". I
usually
On Mon, 2003-10-06 at 00:48, Curt Zirzow wrote:
>
> On the global topic, I would suggest establishing a standard
> naming convention for your common globals that are used, I do
> something like:
> $__object_something__;
>
> With your global var I can see myself writing something that will
> over
* Thus wrote Tom Rogers ([EMAIL PROTECTED]):
> Hi,
>
> Monday, October 6, 2003, 3:20:08 AM, you wrote:
>
>
> To do this I have my classes register themselves in a global array.
> For example a mysql class which gets used a lot does this in its constructor:
>
> function mysql_class($db='',$ini='
Tom Rogers wrote:
To do this I have my classes register themselves in a global array.
For example a mysql class which gets used a lot does this in its constructor:
function mysql_class($db='',$ini=''){
global $class_ref;
$class_ref["mysql_class"] =& $this;
.
.
.
}
Then any class that needs ac
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 i
I would have to see your code, 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? Personally, I see your user class being the
only one which nee
Jeremy Johnstone wrote:
What I would do is pass the handles to the objects in the class
constructor by reference. For example create one db object similar to
this:
class database
{
...
}
$db = new database();
and then pass the reference to all other classes like this:
class smarty
{
var $db;
What I would do is pass the handles to the objects in the class
constructor by reference. For example create one db object similar to
this:
class database
{
...
}
$db = new database();
and then pass the reference to all other classes like this:
class smarty
{
var $db;
function smarty(
Dan Anderson wrote:
Out of curiousity, what exactly are you trying to do? Are you sure this
type of framework is most appropriate (and easiest to implement?)
In my current setup, the more classes Im adding to the code, the more
complex things seem to get.
For example.
I have a smarty object that
Out of curiousity, what exactly are you trying to do? Are you sure this
type of framework is most appropriate (and easiest to implement?)
-Dan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Dan Anderson wrote:
Im looking to verify some behaviour Im running into.
When a child extends a parent, from that point on, the parent, has no idea,
on what the child is capable of, or what it contains.
Is that a "real" parent??? ;)
No but if you really wanted to you could create a framew
> Im looking to verify some behaviour Im running into.
> When a child extends a parent, from that point on, the parent, has no idea,
> on what the child is capable of, or what it contains.
> Is that a "real" parent??? ;)
No but if you really wanted to you could create a framework for paren
* Thus wrote Gerard Samuel ([EMAIL PROTECTED]):
> Im trying to create some dummy code where child classes can talk to each
> other.
> Im looking to verify some behaviour Im running into.
> When a child extends a parent, from that point on, the parent, has no idea,
> on what the child is capable of
15 matches
Mail list logo