![]() |
I see the following infos in the debug-toolbar
"[DEPRECATED] Creation of dynamic property App\Libraries\MyLib::$ModulesModel is deprecated in APPPATH/Libraries/MyLib.php on line 128. 1 APPPATH/Controllers/BaseController.php(71): App\Libraries\MyLib->__construct() 2 SYSTEMPATH/CodeIgniter.php(904): App\Controllers\BaseController->initController(Object(CodeIgniter\HTTP\IncomingRequest), Object(CodeIgniter\HTTP\Response), Object(CodeIgniter\Log\Logger)) 3 SYSTEMPATH/CodeIgniter.php(500): CodeIgniter\CodeIgniter->createController() 4 SYSTEMPATH/CodeIgniter.php(355): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false) 5 SYSTEMPATH/Boot.php(325): CodeIgniter\CodeIgniter->run() 6 SYSTEMPATH/Boot.php(67): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter)) 7 FCPATH/index.php(56): CodeIgniter\Boot::bootWeb(Object(Config\Paths))" So have a look at the line i found this Code: //Construct What is wrong with this, and how i can do it, may i dont need to create a own instance of each needed modell in the library!?
You need to declare the property, add the following lines above your __construct():
PHP Code: private object $ModulesModel; Also, read this: https://php.watch/versions/8.2/dynamic-p...deprecated |
Welcome Guest, Not a member yet? Register Sign In |