2levelsabove Posted February 4, 2010 Share Posted February 4, 2010 Yes I have googled it yet the results have been inconsistent. I just want to use the right methodology in terms of OOP development. If I wish to include another class for its functions and/or PHP file what is the proper way to do it? I have also heard of _autoload() and am confused at this point. Would appreciate any help. Thanks //what if I want to include code from phpmailer class?????? class test{ var $test= ""; function test($test) { //constructor $this->url=$test; } function domesomething() { return $result; } } Link to comment https://forums.phpfreaks.com/topic/190973-can-someone-explain-on-how-to-include-other-filesclasses-in-a-php-class/ Share on other sites More sharing options...
Mchl Posted February 4, 2010 Share Posted February 4, 2010 Probably the best way is this: http://php.net/manual/en/language.oop5.autoload.php (or for more advanced usage: spl_autoload_register) Link to comment https://forums.phpfreaks.com/topic/190973-can-someone-explain-on-how-to-include-other-filesclasses-in-a-php-class/#findComment-1007072 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.