Welcome Guest, Not a member yet? Register   Sign In
How To Call A Model Or Class Using Custom Directory Path In Codeigniter 4
#2

Read this: http://codeigniter.com/user_guide/cli/cli.html
You should create a controller for your cron jobs and make your routes accessible only via CLI.
PHP Code:
$routes->cli('tools/message/(:segment)''Tools::message/$1'); 

In your controller, check is_cli() to make sure it's not accessed by a browser.
PHP Code:
if ( ! is_cli()) {
    // error

CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
RE: How To Call A Model Or Class Using Custom Directory Path In Codeigniter 4 - by includebeer - 09-22-2021, 02:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB