2012-02-14 99 views
3

如这里指出: http://codeigniter.com/user_guide/general/cli.htmlCodeIgniter:如果控制器位于文件夹内,从命令行运行脚本?

一个页面,如: http://www.example.com/myController/myFunc/myParam

可以在命令行上运行:

php index.php myController myFunc myParam 

我codeignitor设置有一些文件夹来组控制器,可以这样说:

myFolder -> myPageController 
     -> myAdminController 

因此,该URL变为:

http://www.example.com/myFolder/myController/myFunc/myParam

如何呼吁CLI是一回事吗? 类似于:

php index.php "myFolder/myController" myFunc myParam 

似乎不起作用。

+0

任何想法如何通过CLI执行http://example.com/beta/app/index.php/notification/test/121 – John 2015-04-28 14:29:38

回答

14

你可以尝试:

php index.php myFolder myController myFunc myParam1 myParam2 ... 
1

注意,在类文件索引方法是必要的适当的CLI工作,否则笨将返回404错误。

;)

+0

噢,我的..! Plz的帮助,我该如何解决它?返回404错误=。= – Serip88 2017-01-04 07:41:03