jbe/bsw@0: --[[-- jbe/bsw@0: value = -- value of the id casted to the chosen param_type jbe/bsw@0: param.get_id( jbe/bsw@0: param_type -- desired type of the returned value jbe/bsw@0: ) jbe/bsw@0: jbe/bsw@0: Same as param.get(...), but operates on a special id parameter. An id is set via a __webmcp_id GET or POST parameter or an 'id' option to execute.view{...} or execute.action{...}. In a normal setup a beauty URL of the form http://www.example.com/example-application/example-module/example-view/.html will cause the id to be set. jbe/bsw@0: jbe/bsw@0: --]]-- jbe/bsw@0: jbe/bsw@0: function param.get_id(param_type) jbe/bsw@0: local param_type = param_type or atom.integer jbe/bsw@0: if param._exchanged then jbe/bsw@0: local value = param._exchanged.id jbe/bsw@0: if value ~= nil and not atom.has_type(value, param_type) then jbe/bsw@0: error("Parameter has unexpected type.") jbe/bsw@0: end jbe/bsw@0: return value jbe/bsw@0: else jbe@94: local str = request.get_id_string() jbe@91: if str then jbe@91: return param._get_parser(nil, param_type)(str) jbe@91: else jbe@91: return nil jbe@91: end jbe/bsw@0: end jbe/bsw@0: end