.TH "Eliom_mkforms.MakeForms" 3o 2014-07-10 OCamldoc "" .SH NAME Eliom_mkforms.MakeForms \- no description .SH Module Module Eliom_mkforms.MakeForms .SH Documentation .sp Module .BI "MakeForms" : .B functor (Pages : FORMS_PARAM) -> sig end .sp .sp .B "Parameters:" .sp "Pages" .B Eliom_mkforms.FORMS_PARAM .sp .sp .I type uri = .B Pages.uri .sp .sp .PP .B === .B Forms creation .B === .PP .PP .B === .B Links and forms .B === .PP .I val make_uri : .B ?absolute:bool -> .B ?absolute_path:bool -> .B ?https:bool -> .B service:('get, unit, [< Eliom_service.get_service_kind ], .B [< Eliom_service.suff ], 'gn, unit, [< Eliom_service.registrable ], .B 'return) .B Eliom_service.service -> .B ?hostname:string -> .B ?port:int -> .B ?fragment:string -> .B ?keep_nl_params:[ `All | `None | `Persistent ] -> .B ?nl_params:Eliom_parameter.nl_params_set -> 'get -> Pages.uri .sp The function .B make_uri service get_params returns the URL of the service .B service applied to the GET parameters .B get_params \&. By default the returned URL is relative to the current request URL but it is absolute when one of the following conditions is met: .sp .sp \-the optional parameter .B ~absolute_path is .B true \&. .sp \-the optional parameter .B ~absolute is .B true \&. .sp \-the optional parameter .B ~https is .B true (resp\&. .B false ) and the current request protocol is .B http (resp\&. .B https )\&. .sp \-the optional parameter .B ~https is .B true and the function is used outside of a service handler .sp \-the .B service has been created with .B ~https:true and the current request protocol is .B http \&. .sp \-the .B service has been created with .B ~https:true and the function is used outside of a service handler\&. When only the first condition is met ( .B ~absolute_path is .B true ) the returned URL is just the absolute path, but when any other condition is satisfied the returned URL is prefixed with .B protocol://hostname[:port] , where: .sp .sp \- .B protocol is: .sp \- .B https if the .B service has been created with .B ~https:true or the optional parameter .B ~https is .B true ; .sp \- .B http if the optional parameter .B ~https is .B false ; .sp \-the current request protocol if available; .sp \- .B http in any other case\&. .sp \- .B hostname is: .sp \-the optional parameter .B ~hostname if given; .sp \-the attribute .B defaulthostname of .B tag in configuration file or the machine hostname if the option .B is set; .sp \-the .B Host http header of the current request if available; .sp \-the attribute .B defaulthostname of .B tag in configuration file or the machine hostname in any other case\&. .sp \- .B port is: .sp \-the optional parameter .B ~port if given; .sp \-the attribute .B defaulthttpsport (resp\&. .B defaulthttpport ) of .B tag in configuration file or .B 443 (resp\&. 80) if .B protocol is .B https (resp\&. .B http ) and the current request protocol is .B http (resp\&. .B https ); .sp \-the attribute .B defaulthttpsport (resp\&. .B defaulthttpsport ) of .B tag in configuration file or .B 443 (resp\&. 80) if the option .B is set and .B protocol is .B https (resp\&. .B http ); .sp \-the port associated to the .B Host http header of the current request if available; .sp \-the incoming port of the current request if available; .sp \-the attribute .B defaulthttpport (resp\&. .B defaulthttpsport ) of .B tag in configuration file or .B 80 (resp\&. .B 443 ) in any other case\&. If given the optional parameter .B ~fragment is prefixed by .B # and appended to the URL\&. .sp The optional parameter .B keep_nl_params allows one to override the .B keep_nl_params parameter used when creating the .B service , see .B Eliom_service\&.Http\&.service for a detailled description\&. .sp The optional parameter .B nl_params allows one to add non localized GET parameter to the URL\&. See the eliom manual for more information about \&. .sp .sp .I val make_string_uri : .B ?absolute:bool -> .B ?absolute_path:bool -> .B ?https:bool -> .B service:('get, unit, [< Eliom_service.get_service_kind ], .B [< Eliom_service.suff ], 'gn, unit, [< Eliom_service.registrable ], .B 'return) .B Eliom_service.service -> .B ?hostname:string -> .B ?port:int -> .B ?fragment:string -> .B ?keep_nl_params:[ `All | `None | `Persistent ] -> .B ?nl_params:Eliom_parameter.nl_params_set -> 'get -> string .sp The function .B make_string_uri service get_params returns the URL of the of the service .B service applied to the GET parameters .B get_params \&. See .B make_uri for a detailled description of optional parameters\&. .sp The function .B make_string_uri is an alias of .B Eliom_uri\&.make_string_uri \&. .sp Warning: The function .B make_string_uri should not be called outside of a service handler, unless one of the following condition is met: .sp .sp \-the optional parameter .B ~absolute_path is .B true \&. .sp \-the optional parameter .B ~absolute is .B true \&. .sp \-the optional parameter .B ~https is .B true \&. .sp \-the .B service has been created with .B ~https:true \&. .sp \-the .B service is an external service\&. .sp .sp .I val uri_of_string : .B (unit -> string) -> Pages.uri .sp The function .B uri_of_string f returns a URI whose content is equivalent to .B f () \&. .sp For XML tree build with TyXML, like .B Html5 or .B Svg\&.F , the function .B f is applied each time the XML tree is sent to the client (either as page content or as a marshalled OCaml value)\&. Hence, the function is always evaluated in the context of a service handler\&. .sp For other module, the function .B f is immediatly applied\&. .sp .sp .I val make_uri_components : .B ?absolute:bool -> .B ?absolute_path:bool -> .B ?https:bool -> .B service:('get, unit, [< Eliom_service.get_service_kind ], .B [< Eliom_service.suff ], 'gn, unit, [< Eliom_service.registrable ], .B 'return) .B Eliom_service.service -> .B ?hostname:string -> .B ?port:int -> .B ?fragment:string -> .B ?keep_nl_params:[ `All | `None | `Persistent ] -> .B ?nl_params:Eliom_parameter.nl_params_set -> .B 'get -> string * (string * Eliommod_parameters.param) list * string option .sp The function .B make_uri_components service get_params returns the a triplet .B (path, get_params, fragment) that is a decomposition of the URL for the service .B service applied to the GET parameters .B get_params \&. By default the returned .B path is relative to the current request URL but it could be absolute URL in some situation, see .B make_uri for more information and a description of optional parameters\&. .sp The function .B make_uri_components is an alias for .B Eliom_uri\&.make_uri_components \&. .sp Warning: depending on the optional parameters, the function .B make_uri_components may not be used outside of a service handler\&. See .B make_string_uri for a detailled description\&. .sp .sp .I val make_post_uri_components : .B ?absolute:bool -> .B ?absolute_path:bool -> .B ?https:bool -> .B service:('get, 'post, [< Eliom_service.post_service_kind ], .B [< Eliom_service.suff ], 'gn, 'pn, [< Eliom_service.registrable ], .B 'return) .B Eliom_service.service -> .B ?hostname:string -> .B ?port:int -> .B ?fragment:string -> .B ?keep_nl_params:[ `All | `None | `Persistent ] -> .B ?nl_params:Eliom_parameter.nl_params_set -> .B ?keep_get_na_params:bool -> .B 'get -> .B 'post -> .B string * (string * Eliommod_parameters.param) list * string option * .B (string * Eliommod_parameters.param) list .sp Same a .B make_uri_components , but also returns a list of post parameters\&. .sp .sp .I val a : .B ?absolute:bool -> .B ?absolute_path:bool -> .B ?https:bool -> .B ?a:Pages.a_attrib_t -> .B service:('get, unit, [< Eliom_service.get_service_kind ], .B [< Eliom_service.suff ], 'd, unit, [< Eliom_service.registrable ], .B [< Eliom_service.non_ocaml_service ]) .B Eliom_service.service -> .B ?hostname:string -> .B ?port:int -> .B ?fragment:string -> .B ?keep_nl_params:[ `All | `None | `Persistent ] -> .B ?nl_params:Eliom_parameter.nl_params_set -> .B ?xhr:bool -> 'a Pages.a_content_elt_list -> 'get -> 'a Pages.a_elt .sp The function .B a service a_content get_params creates a .B node that link to .B service applied to GET parameters .B get_params and whose content is .B a_content \&. By default, the .B href attribute is a relative URL recomputed at each request with .B make_uri \&. .sp By default, the link is realized such that the client\-side Eliom application keeps running irrespectable of the usage of the link (cf\&. )\&. .sp By contrast, if the optional parameter .B ~xhr:false is given, the link is realized as a standard HTML link and clicking it discontinues the Eliom application\&. The .B ~xhr parameter has no effect outside an Eliom application\&. .sp NB that the default value of .B ~xhr is configurable through <> .sp The optional parameter .B ~a allows one to add extra HTML attributes to the generated node\&. .sp See .B make_uri for description of other optional parameters\&. .sp .sp .I val css_link : .B ?a:Pages.link_attrib_t -> uri:Pages.uri -> unit -> Pages.link_elt .sp The function .B css_link ~uri () creates a .B node that reference a Cascading StyleSheet (CSS)\&. .sp If the CSS is generated by an Eliom service, use .B make_uri to calculate the service URI\&. If the CSS is a static file, you may also use .B Eliom_service\&.static_dir or .B Eliom_service\&.Http\&.external_service to abstract the file with a service\&. .sp The optional parameter .B ~a allows one to add extra HTML attributes to the generated node\&. .sp .sp .I val js_script : .B ?a:Pages.script_attrib_t -> uri:Pages.uri -> unit -> Pages.script_elt .sp The function .B js_script ~uri () creates a .B