Jump to content

Calling METHODS in CLASSES from within OTHER CLASSES?!?!?!


Sylmand

Recommended Posts

class c1 {

    public function test() {

        echo 'test';

    }

}

 

class c2 {

    public function test2($c1) {

        $c1->test();

    }

}

 

$c = new c1;

$c2 = new c2;

$c2->test2(c2);

 

 

There are of course other ways to get instances inside of other classes.

 

You could use a static function also....

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.