New Param from a custom event
This is an open discussion with 2 replies, filed under General.
Search
Hi Andre,
The parameter you create from an Event is only valid for a single page. (on which your event is running). Unless your event runs on every page and stores the above data it will not work.
I would suggest that you use your event to store session data & then use a delegate in your extension to actually display the value across all pages. (if I understood correctly)
Not sure if i did in the correct way however did work fine for my needs.
Please symphony guys, correct me if i was wrong and there is a better way to do it.
Everything that i need is to use a param on my next pages...
Inside my Custom Event i have inserted in the middle of my code inside the _trigger();
$_SESSION['MY_PARAM_NAME'] = (string)$string;
Now, on my load() before the if(isset($_POST['action']['my-action'])) return $this->__trigger();
i have inserted:
if($_SESSION['MY_PARAM_NAME']) { Frontend::instance()->Page()->_param['ErrorMessage'] = $_SESSION['MY_PARAM_NAME']; }
That worked :)
Now i have the parameter that i need in the next couple of pages.
Cheers.
Create an account or sign in to comment.
Hey guys ,
I am trying to create a new env_->parameter from a custom event using:
However as soon as i go to the next page and try to access the ?debug=params my parameter is not there....
Giving a var dump on my event i can see the data there but seems like Symphony replace everything in the next page.
thoughts, helps?
Regards. Andre.