开发者

Access codeigniter controller from command line

开发者 https://www.devze.com 2023-02-06 11:22 出处:网络
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/)

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

精彩评论

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