[FLOW3-core] Web and CLI supported Request types for ActionController. Fluid for Web - what to use with CLI?

Thomas Fritz fritztho at gmail.com
Mon Aug 9 16:47:36 CEST 2010


Hi!

I have ActionController which works just fine over Web and the CLI. I have
added the CLI Request to the supportedRequestTypes Array of the Controller.
For the Web Request i would like to use Fluid as my Templating Framework -
which works. But when i call an action of this controller from the command
line, the Framework correctly tells me that it can not find a template for
this request. I understand that i can not use Fluid for CLI "Requests" but
how can i then use the same controller with the same logic for different
Request Types? What is the proposed way? I could check the class of
$this->request, but i am not really happy with that.


Another question related to that: What is the proposed way when i have one
or more ActionControllers for both Web and CLI Requests and i want to get
input from the user. On Web Requests it is obvious - i create a Form and
submit it, or passing them via GET Parameters - then i process the arguments
in the called action, right?
In my case it is not possible to set the arguments when calling on the
command line. I have to read from stdinput to get the arguments. So how can
i create most compatible ActionControllers for both use cases / request
types?
I thought of creating a special CLI Controller, get input from the user and
then forward to the real controller action with the arguments via
$this->forward(). Would you recommend that? How would you do that?


Kind regards

---

*Thomas FRITZ*
*web* http://fritzthomas.com
*twitter* http://twitter.com/thomasf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.typo3.org/pipermail/flow3-team-core/attachments/20100809/c5333c3d/attachment.htm>


More information about the FLOW3-team-core mailing list