How To Call A Model Or Class Using Custom Directory Path In Codeigniter 4 |
Guy, I need support here For Codeigniter 4.
Please Help. I have a folder and file in a root directory with full path: TestingWebsite\app\CronJob\ExportAlert.php The File Is Not In Controller. Inside the ExportAlert.php the code: Code: <?php I want to call the model : Code: $Utility = new \App\Models\Dennis_utility_model(); // Error In Here Class Not Found Inside the ExportAlert.php But I got Error: Class Not Found For Every Model I called. I have a reason why I don't want to put it inside the controller. Because I want to run a scheduled task cron job. And to prevent unauthorized users to run it from the browser. And spam it. How I can call a model or class from outside controller use a custom directory? In the file ExportAlert.php, I didn't use the class. And just use a native PHP with the model. Is it possible? What is the correct way to call it? Remember this is codeigniter 4 not codeigniter 3. Thank You |
Messages In This Thread |
How To Call A Model Or Class Using Custom Directory Path In Codeigniter 4 - by cloudytechi147 - 09-22-2021, 05:50 AM
RE: How To Call A Model Or Class Using Custom Directory Path In Codeigniter 4 - by includebeer - 09-22-2021, 02:50 PM
RE: How To Call A Model Or Class Using Custom Directory Path In Codeigniter 4 - by iRedds - 09-24-2021, 11:33 PM
RE: How To Call A Model Or Class Using Custom Directory Path In Codeigniter 4 - by paliz - 09-25-2021, 10:31 AM
|