[Flow] Create Link outside of controller

Christian Loock chl at vkf-renzel.de
Wed Apr 9 12:44:51 CEST 2014


I'm actually inside a model and want to generate a link with data that 
is stored inside the model.

Imagine a edit history that stores pages a user has called. I am 
curently storing action, controller etc. seperatly, but figured out, 
that it would be much easier just to store the whole URL instead. 
However, the tip is really appreciated, as it might become handy in the 
future :)

On 09.04.2014 12:39, Bastian Waidelich wrote:
> Christian Loock wrote:
>
> Hi Christian,
>
>> when I am not inside a controller [...]
>
> Where are you then?
>
>
>> Is there a simple way to generate an URL inside Flow when not being in
>> the context of a controller?
>
> There are several but it really depends on what the context *is*.
> If you really have no access to the current action- or HTTP request 
> you can create one with:
>
> $httpRequest = Request::createFromEnvironment();
> $actionRequest = $httpRequest->createActionRequest();
>
> But note that the second line is not public API and subject to change.
>

-- 
Christian Loock
Web Developer
Renzel Agentur
www.renzel-agentur.de



More information about the Flow mailing list