-
- 222 Posts
I need to change the target for redirect hook based on certain conditions from another hook. I call FormIt with this:
[[!FormIt?
&hooks=`myHook,redirect`
&redirectTo=`149`
&store=`1`
...
In [tt]myHook[/tt] I use this to change the [tt]&redirectTo[/tt] value:
$hook->formit->config['redirectTo'] = 148
This actually works and redirects to resource 148 instead of 149. What is essential here, the redirect can’t be invoked from inside the hook to not disturb the form submission and saving values to cache. Is this how it should be done or is there a more proper way to do it? I’m using FormIt 1.7.
This is the web: the only thing you know about who will come is that you don't know who will come.
-
- 105 Posts
Wow, thank you for sharing this. I have been trying to do something like this for a month or two.
You may or may not want to use the code I write. It's probably all against the syntax rules of php and MODx.
Carpet Cleaning
-
- 222 Posts
You're welcome
This is the web: the only thing you know about who will come is that you don't know who will come.