开发者

Access codeigniter controller from command line

I'm playing around with CI around PHP CLI.

I'm now able to access the whole CI structure via a Global variable $CI (followed the tutorial here http://codeigniter.com/wiki/dip_into_CI/)

$CI = new $class();
$CI -> load->view ('header');

Now works good, but I don't know how to access a controller thru the $CI variabl开发者_StackOverflowe.

Let's say I have a controller called main(); i'd like to be able to do something like :

$CI->main->myfunction($params);

Must be real simple but can't figure out


That's all possible but a little crazy. Just use CodeIgniter Reactor. Controllers can respond to command line perfectly.

https://bitbucket.org/ellislab/codeigniter-reactor

php index.php controller method param1 param2

Works with routing and everything.


Yes.. It works with MX and the "regular" CI that you download from codeigniter.com.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜