[Flow] Accessing settings in command-line controller
Christian Loock
chl at vkf-renzel.de
Thu Apr 10 07:59:52 CEST 2014
You settings should be accesible by just injecting it. Add a
injectSettingsmethod to your controller, so the settings can be
injected. As far as the Abstract Controller goes, I used to do this
aswell, but am currently working on eleminating this sort of dependency
in my code. You might want to put those constants and variables inside a
seperate class, which you then could just load inside you controllers.
Also, ViewHelpers can help do a lot of the work that you would want to
do in a abstractController itself. As far as loading the
AbstractController inside a CommandController goes, you can't really.
Unless you make those variables static.
On 09.04.2014 18:38, Cornel Widmer wrote:
> Hi folks
>
> Maybe someone of you can help me out with this problem. I've a some
> paths written in my Settings.yaml and a lot of constants and variables
> in an abstract controller for my flow application.
>
> Now, I want to access some of them (paths from settings and variables
> from the abstract controller) in a command line controller. But
> obviously the retrieving from Settings.yaml does not work out of the box.
>
> Logically I cant acces the variables of my abstract controller as I
> can not extend from the abstract controller.
>
> Can someone point me in the right direction to sail around these
> design flaws of my application. I really want to learn, so every tipp
> is very appreciated.
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
--
Christian Loock
Web Developer
Renzel Agentur
www.renzel-agentur.de
More information about the Flow
mailing list