I have 2 files, class.inc.php and index.php.
class.inc.php contains Myclass and few functions, index.php file spits out functions from class.inc.php.
Now I need to create a function which will include/require a file and that function should actually require that file in index.php not in class.inc.php.
Yes I know I can place my file in a function and call it that way but we have to keep it in files because of some future MVC overrides. I do not want to include a file in index.php directly either if all possible. So is there a way to do this?
In my index.php I should be able to do this:
Myclass::include(PARAMS);
and that should include a file name params.php located somewhere else.
I tried this in class.inc.php
abstract class Myclass {
static function load($filename){
require_once $filename;
}
}
and this in
index.php
Myclass::include(PARAMS);
but none of my variables from params.php are visible in index.php because they seem to be in class.inc.php.
includeis done?params.php?