PHP methods as functions // change scope -


i have class such as

class myclass {      function mymethod(){          include(something);      }      function callme(){      }  } 

i want call callme()from include rather than$this->callme();

i hope makes sense?

something this?

class myclass {      public function mymethod(){          include(something);      }      public function callme(){      }  } 

some other php file:

include 'myclass.php'; $myclass = new myclass(); $myclass->callme(); 

Comments

Popular posts from this blog

What can cause "Required Package 'IndyCore' not found" when compiling a Delphi 2010 project? -

Change the color of an oval at click in Java AWT -