Forums / Developer / How to send module result back to the form page ?
Franck Grenier
Thursday 17 December 2009 1:04:25 am
Hello, I've created a quizz extension with a module that handles the user answer. The quizz form is submitted to my module at "quizz/reponse". After the module actions, I would like to go back to the quizz page with the result of the module.How can I do that ?
Developer at Open Wide
Jérôme Vieilledent
Monday 21 December 2009 2:51:59 am
Hi Franck
First, you may use eZ Survey extension for that ;).
eZ Publish sets a LastAccessesURI session variable. Then, what you to do is to check if it exists and redirect the user to this URI or to a default one.
Example :
$Module = $Params['Module']; $http = eZHTTPTool::instance(); if ( $http->hasSessionVariable( "LastAccessesURI" ) ) // Check if LastAccessesURI exists $userRedirectURI = $http->sessionVariable( "LastAccessesURI" ); else $userRedirectURI = 'content/view/full/2'; // Default redirect $Module->redirectTo( $userRedirectURI );