webmcp

diff framework/env/request/forward.lua @ 0:9fdfb27f8e67

Version 1.0.0
author jbe/bsw
date Sun Oct 25 12:00:00 2009 +0100 (2009-10-25)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/framework/env/request/forward.lua	Sun Oct 25 12:00:00 2009 +0100
     1.3 @@ -0,0 +1,17 @@
     1.4 +--[[--
     1.5 +request.forward{
     1.6 +  module = module,  -- module name
     1.7 +  view   = view     -- view name
     1.8 +}
     1.9 +
    1.10 +This function is called automatically to forward to another view, after an action and all its filters have finished execution, if routing mode "forward" has been chosen. Calling request.forward{...} (or request.redirect{...}) explicitly inside an action will cause routing information from the browser to be ignored. Calling request.forward{...} causes all GET/POST parameters of the action to be preserved for the given view.
    1.11 +
    1.12 +--]]--
    1.13 +
    1.14 +function request.forward(args)
    1.15 +  if request.is_rerouted() then
    1.16 +    error("Tried to forward after another forward or redirect.")
    1.17 +  end
    1.18 +  request._forward = args
    1.19 +  trace.forward { module = args.module, view = args.view }
    1.20 +end

Impressum / About Us