php - Use class methods inside included file in a class -
i new object oriented programming.
question , including file inside class method.
how can use class methods inside required file? used $this->two()
, works fine don't think best way .if 1 else reading code , difficult him understand code.
alternative this?
//main.php class test{ public function one(){ .... require('file.php'); } public function two(){ .... } public function three(){ .... } } ?> //file.php <div> <?php $this->two(); ?> </div>
you can create object class , call method
$c = new test; $c->two();
Comments
Post a Comment