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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -