开发者

Does requestAction work on command line?

开发者 https://www.devze.com 2023-03-13 06:01 出处:网络
I am a newbie to cakephp and recently used a function $this->requestAction(); whic开发者_开发知识库h allows you interact between different controllers. But now I\'m curious to know whether it works

I am a newbie to cakephp and recently used a function $this->requestAction(); whic开发者_开发知识库h allows you interact between different controllers. But now I'm curious to know whether it works fine through command line or not? Thanks


This behavior should work just fine through the command line; or, I should say that any CakePHP function called through the command line should work just as it would through the browser. As long as your system allows it, PHP does the same thing despite the origin of the request.

If you are looking to separate command line functionality from Web functionality, then you may try Googling for creating a command line only dispatcher. Then, you can add some code to your controller that will only respond if the request is made from the command line. I do this for CRON jobs for my apps.

0

精彩评论

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