facebook twitter hatena line email

Php/codeigniter/コマンド

提供: 初心者エンジニアの簡易メモ
2025年4月21日 (月) 04:49時点におけるAdmin (トーク | 投稿記録)による版

移動: 案内検索

コマンドでクラス実行

アプリケーションpathが、ci3appだったとき、Citestクラスのindexメソッドにアクセスする

env CI_ENV=development php ci3app/index.php citest index
class Citest extends MY_Controller {
    public function index()
    {
        echo 'citest/index';
    }
}


アプリケーションpathが、application_project_path1だったとき、Batchクラスのtestメソッドにアクセスする

CI_ENV=production php application_project_path1/index.php batch test
class Batch extends MY_Controller
{
    public function test()
    {
        echo 'batch/test';
    }
}

参考:https://qiita.com/horikeso/items/69b5329d87b30aa35d68