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); Link to comment https://forums.phpfreaks.com/topic/289341-need-help-adding-dynamic-include-expression/ 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? Link to comment https://forums.phpfreaks.com/topic/289341-need-help-adding-dynamic-include-expression/#findComment-1483396 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(); Link to comment https://forums.phpfreaks.com/topic/289341-need-help-adding-dynamic-include-expression/#findComment-1483411 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.