Created
March 31, 2014 02:10
-
-
Save mugyu/9883863 to your computer and use it in GitHub Desktop.
CodeIgniter のコントローラーをコマンドラインから起動する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// # CodeIgniter のコントローラーをコマンドラインから起動する | |
// | |
// 1. `application/controllers/say.php` を作成(このファイル) | |
// 2. `localhost/say/hello` とかのURLでアクセスすると | |
// hello, world! とブラウザーで閲覧出来る。 | |
// 3. コマンドラインで `php index.php say hello "hoge"` と入力すると | |
// hello, hoge! と標準出力に出力される。 | |
<?php | |
class Say extends CI_Controller { | |
public function hello($to = 'wrold') | |
{ | |
echo "hello, {$to}!\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment