eldan88 Posted June 29, 2014 Share Posted June 29, 2014 Hey Guys. I am trying to include a file. The file path gets returns from an objects method. When a run is_file() on the returned data it returns true, but does not include it!!! Can anyone please help me solve this!! class StoreInitialization { public function loadConfigFile(){ $config_file="../store/demo/store_configuration.php"; return $config_file; } Client Code $store_config_file = $store_initialization->loadConfigFile(); require($store_config_file); Quote Link to comment Share on other sites More sharing options...
Drongo_III Posted June 29, 2014 Share Posted June 29, 2014 I would suggest two possibipities: 1) check your include path -get_include_path 2) could it be that you are returning a relative path? Quote Link to comment Share on other sites More sharing options...
Zane Posted June 30, 2014 Share Posted June 30, 2014 You need to instantiate a new instance.. $store = new StoreInitialization; $store_config_file = $store->loadConfigFile(); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.