From: David A. <da...@ho...> - 2010-11-30 02:36:35
|
Pass $this to the "Other_Class" via constructor: $this->other_class = new Other_Class($this); Both x and y will need to have public visibility in order for Other_Class to access them directly like that. Otherwise you will need to implement __get() or use specific getters. On Nov 29, 2010, at 6:20 PM, Walter wrote: > I have 2 classes, the first instantiates the second... > > $this->other_class = new Other_Class; > > Now I would like to the constrictor of Other_Class "know" who called > it and pull property data from that class. > > Say I have this.. > > $this->x = 6; > $this->y = true; > > How can the constructor of Other_Class pull the values of 'x' and 'y' > from the first class? > > Any ideas? > > Thanks > > Walter > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss -- David Abdemoulaie http://hobodave.com/ http://twitter.com/hobodave |