Jump to content

Recommended Posts

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]
<?php

class 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]
Link to comment
https://forums.phpfreaks.com/topic/27253-callingreferencing-methods-oop/
Share on other sites

you got it backwards there........when you extend a class it just means your essentially including the class and all it's properties
not adding on to it......

so in your case, when you extend ircbot, you're not really including anything at all
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.