From: Arnold C. <arn...@ya...> - 2003-01-13 16:40:52
|
Ross is correct that in Struts the REDIRECT flag determines whether the system uses the forward() or sendRedirect() method. However, since PHP does not have an equivalent to the forward() method, Phrame uses the header() method in both cases. The only difference being that when the REDIRECT flag is in place the session information is destroyed before the header(). Does anyone know if there is a way to "forward" to another page on the server (server side) without using the header() method? I may be wrong but my understanding is that the header('Location: '.$path) method asks the browser to fetch the $page (client side). Arnold --- Jason Sweat <jsw...@ya...> wrote: > --- Ross Keatinge <ro...@po...> wrote: > > I think there is a need for both. Isn't that what > the 'forward' or > > 'redirect' choice in the mapping does in Struts? > Certainly if your > > initial request is a GET then I don't see why it > should always come > > back with a redirect. Maybe that is what you mean, > only force it to > > happen with a POST. > > I would agree with that. I think this could be > accomplished by using setting > the _REDIRECT setting for each _ACTION_FORWARD array > to true or false. The > ActionController would then either: > if (_REDIRECT) { > header('Location: '._PATH); > } else { > $_GET[_VIEW] = [view portion of _PATH] > } > > the application.php would look like: > > if (!array_key_exists(_CONTROLLER, $_SESSION)) { > $controller = new ActionController($options); > $_SESSION[_CONTROLLER] = $controller; > } > $controller = &$_SESSION[_CONTROLLER]; > if (array_key_exists(_ACTION, $_REQUEST)) { > //release control to controller for further > processing > $controller->process($mappings, $_REQUEST); > } > $controller->showView(); > > That way, if there is an action specified, process > it. If it redirects, you > are done, else you always try to display a view > (either action did not > redirect, or there was no action specified to begin > with). > > Regards, > > Jason > > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up > now. > http://mailplus.yahoo.com > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = > Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Phrame-devel mailing list > Phr...@li... > https://lists.sourceforge.net/lists/listinfo/phrame-devel __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |