I have seperated a few file with PHP classes, and now I need to get them together in one function like this:
include("require-class.php"); require_multi("db-class.php", "settings.php","users-class.php"); class ajaxLogin { private $settings; private $users; public function __construct(settings $settings, users $users) { $this->settings = $settings; $this->users = $users; } } global $ajaxLogin; $ajaxLogin = new ajaxLogin; Class in settings.php is named settings and the one in users-class.php is users. I got an error:
PHP Catchable fatal error: Argument 1 passed to ajaxLogin::__construct() must be an instance of settings, none given, called in /var/www/html/idcms/admin/class/login-ajax.php on line 47 and defined in /var/www/html/idcms/admin/class/login-ajax.php on line 13, referer: http://localhost/idcms/admin/