Hi,
is there a way to send a sessionMessage without a form.
It is supposed to be a response to an action.
Thanks,
Dirkr
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hi,
is there a way to send a sessionMessage without a form.
It is supposed to be a response to an action.
Thanks,
Dirkr
Hi,
you can check this with PHP, if you have access to this method without create the object form.If this doesn't work, you can create a Javascript or you create a simple PHP method to send a response like sessionMessage.
Best regards,
Pascal
Thanks for your response,
I was hoping there was something already built in ;-)
Sth like the flash technique in Rails, where a message could be saved in the session and would be shown on the next page.
Have fun,
Dirkr
I don't know if there's a way already set in SS to do it, but alternatively you can set the variable session in PHP.
$FormInfo = array("NameOfTheFormOrWhatever" => array("formError" => array( "message" => "your message", "type" => "good")) );
Session::set("FormInfo", array_merge( Session::get("FormInfo"), $FormInfo ) );
The array_merge thing is just to not overwrite other form variables in case there were.
I guess you probably new this. But just in case I post it.