[FLOW3-general] Use ActionController for Web Requests and CLI, when using Fluid as Templating Engine for Web Requests.
Thomas Fritz
fritztho at gmail.com
Tue Aug 31 18:06:24 CEST 2010
Hi!
I have an ActionController which is working 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 also works and is no problem, 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.
I have a project where i have many use cases where i have to provide the
logic in both ways - Web and over the CommandLine. So how have you thought
to use Controllers for both Endpoints?
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 and then i can process them
via the action parameters.
In my case it is not possible to set the arguments when calling on the
command line. I want to ask the user within the action and read from
stdinput to get the arguments. So how can i create most compatible
ActionControllers for both use cases / request types?
Sorry, for reposting my questions here again (i had posted a similiar
question to the core list), but i really need that informations. I have a
project where i extensively use FLOW3 on both Web and the Linux Command
Line. I will provide more information as soon i have a first prototype, but
for that i need some input.
Kind regards
---
*Thomas FRITZ*
*web* http://fritzthomas.com
*twitter* http://twitter.com/thomasf
More information about the FLOW3-general
mailing list