「Php/codeigniter/コマンド」の版間の差分
提供: 初心者エンジニアの簡易メモ
行1: | 行1: | ||
==コマンドでクラス実行== | ==コマンドでクラス実行== | ||
+ | ===パターン1=== | ||
アプリケーションpathが、ci3appだったとき、Citestクラスのindexメソッドにアクセスする | アプリケーションpathが、ci3appだったとき、Citestクラスのindexメソッドにアクセスする | ||
env CI_ENV=development php ci3app/index.php citest index | env CI_ENV=development php ci3app/index.php citest index | ||
行11: | 行12: | ||
</pre> | </pre> | ||
− | + | ===パターン2=== | |
アプリケーションpathが、application_project_path1だったとき、Batchクラスのtestメソッドにアクセスする | アプリケーションpathが、application_project_path1だったとき、Batchクラスのtestメソッドにアクセスする | ||
CI_ENV=production php application_project_path1/index.php batch test | CI_ENV=production php application_project_path1/index.php batch test |
2025年4月21日 (月) 04:50時点における版
コマンドでクラス実行
パターン1
アプリケーション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'; } }
パターン2
アプリケーション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'; } }