.josh Posted November 14, 2006 Share Posted November 14, 2006 okay i'm (still) an oop noob. I'm just messing around trying to figure out how this whole class thing works. I guess I'm asking for a few pointers here, on how would I access the methods etc.. here's what my structure looks like so far:[code]<?phpclass ircBot {} // end class ircBot class serverInteraction extends ircBot { } // end class serverInteraction class userInteraction extends ircBot { function uIecho() { echo "this is an echo from userInteraction class!"; } // end function uIecho } // end class userInteraction class chatUserControls extends userInteraction { function cUecho () { echo "this is an echo from chatUserControls class!"; } // end function cUecho } // end class chatUserControls class adminControls extends userInteraction { } // end class adminControls class botAdminControls extends adminControls { function bAecho () { echo "this is an echo from botAdminControls class!"; } // end function bAecho } // end class botAdminControls class chatOperControls extends adminControls { } // end class chatOpercontrols$crayonBot = new ircBot;// okay now how would i echo each of those strings??>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/27253-callingreferencing-methods-oop/ Share on other sites More sharing options...
.josh Posted November 15, 2006 Author Share Posted November 15, 2006 *bump* anyone? Quote Link to comment https://forums.phpfreaks.com/topic/27253-callingreferencing-methods-oop/#findComment-124868 Share on other sites More sharing options...
Zane Posted November 15, 2006 Share Posted November 15, 2006 you got it backwards there........when you extend a class it just means your essentially including the class and all it's propertiesnot adding on to it......so in your case, when you extend ircbot, you're not really including anything at all Quote Link to comment https://forums.phpfreaks.com/topic/27253-callingreferencing-methods-oop/#findComment-124874 Share on other sites More sharing options...
.josh Posted November 15, 2006 Author Share Posted November 15, 2006 then how come I can't do like...$crayonBot->uIecho();or $crayonBot->userInteraction::uIecho();i'm not getting it.. :( Quote Link to comment https://forums.phpfreaks.com/topic/27253-callingreferencing-methods-oop/#findComment-124878 Share on other sites More sharing options...
Barand Posted November 15, 2006 Share Posted November 15, 2006 Does my mini-tute help?http://www.phpfreaks.com/forums/index.php/topic,104878.msg418672.html#msg418672 Quote Link to comment https://forums.phpfreaks.com/topic/27253-callingreferencing-methods-oop/#findComment-124884 Share on other sites More sharing options...
.josh Posted November 15, 2006 Author Share Posted November 15, 2006 ..yeah barand.. i guess i see now what zanus means when he says i've got it backwards. oops. hahahhaa I did a play on words :)<is stupid 2.0> Quote Link to comment https://forums.phpfreaks.com/topic/27253-callingreferencing-methods-oop/#findComment-124887 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.