package eliom
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=a989128ffd2ffd4a74b17233cd0a4b46
sha512=ee76f43609fc33aad96758e9a9698ec517aa92eaaf4575e3e4b43aaa34b3659f0403370d1c8a20c605465802375cbdf7f98a0d086cb3c73e86d19115064f7f15
doc/eliom.server/Eliom_form/Make_links/index.html
Module Eliom_form.Make_linksSource
Parameters
Signature
val make_uri :
?absolute:bool ->
?absolute_path:bool ->
?https:bool ->
service:
('get, unit, Eliom_service.get, _, _, _, _, _, _, unit, _) Eliom_service.t ->
?hostname:string ->
?port:int ->
?fragment:string ->
?keep_nl_params:[ `All | `Persistent | `None ] ->
?nl_params:Eliom_parameter.nl_params_set ->
'get ->
H.uriThe function make_uri service get_params returns the URL of the service service applied to the GET parameters 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:
- the optional parameter
~absolute_pathistrue. - the optional parameter
~absoluteistrue. - the optional parameter
~httpsistrue(resp.false) and the current request protocol ishttp(resp.https). - the optional parameter
~httpsistrueand the function is used outside of a service handler - the
servicehas been created with~https:trueand the current request protocol ishttp. - the
servicehas been created with~https:trueand the function is used outside of a service handler.
When only the first condition is met (~absolute_path is true) the returned URL is just the absolute path, but when any other condition is satisfied the returned URL is prefixed with protocol://hostname[:port], where:
protocolis:httpsif theservicehas been created with~https:trueor the optional parameter~httpsistrue;httpif the optional parameter~httpsisfalse;- the current request protocol if available;
httpin any other case.
hostnameis:- the optional parameter
~hostnameif given; - the attribute
defaulthostnameof<host>tag in configuration file or the machine hostname if the option<usedefaulthostname/>is set; - the
Hosthttp header of the current request if available; - the attribute
defaulthostnameof<host>tag in configuration file or the machine hostname in any other case.
- the optional parameter
portis:- the optional parameter
~portif given; - the attribute
defaulthttpsport(resp.defaulthttpport) of<host>tag in configuration file or443(resp. 80) ifprotocolishttps(resp.http) and the current request protocol ishttp(resp.https); - the attribute
defaulthttpsport(resp.defaulthttpsport) of<host>tag in configuration file or443(resp. 80) if the option<usedefaulthostname/>is set andprotocolishttps(resp.http); - the port associated to the
Hosthttp header of the current request if available; - the incoming port of the current request if available;
- the attribute
defaulthttpport(resp.defaulthttpsport) of<host>tag in configuration file or80(resp.443) in any other case.
- the optional parameter
If given the optional parameter ~fragment is prefixed by # and appended to the URL.
The optional parameter keep_nl_params allows one to override the keep_nl_params parameter used when creating the service, see Eliom_service.create for a detailed description.
The optional parameter nl_params allows one to add non localized GET parameter to the URL. See the eliom manual for more information about <<a_manual chapter="server-params"
fragment="nonlocalizedparameters"|non localized
parameters>>.
The function uri_of_string f returns a URI whose content is equivalent to f ().
For XML tree build with TyXML, like Html or Svg.F, the function 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.
For other module, the function f is immediately applied.
val css_link :
?a:[< Html_types.link_attrib ] H.attrib list ->
uri:H.uri ->
unit ->
[> Html_types.link ] H.eltThe function css_link ~uri () creates a <link> node that reference a Cascading StyleSheet (CSS).
If the CSS is generated by an Eliom service, use make_uri to calculate the service URI. If the CSS is a static file, you may also use Eliom_service.static_dir or Eliom_service.extern to abstract the file with a service.
The optional parameter ~a allows one to add extra HTML attributes to the generated node.
val js_script :
?a:[< Html_types.script_attrib ] H.attrib list ->
uri:H.uri ->
unit ->
[> Html_types.script ] H.eltThe function js_script ~uri () creates a <script> node that reference a javascript file.
If the script content is generated by an Eliom service, use make_uri to calculate the service URI. If it is a static file, you may also use Eliom_service.static_dir or Eliom_service.extern to abstract the file with a service.
The optional parameter ~a allows one to add extra HTML attributes to the generated node.
val a :
?absolute:bool ->
?absolute_path:bool ->
?https:bool ->
?a:[< Html_types.a_attrib ] H.attrib list ->
service:
('get,
unit,
Eliom_service.get,
_,
_,
_,
_,
_,
_,
unit,
Eliom_service.non_ocaml)
Eliom_service.t ->
?hostname:string ->
?port:int ->
?fragment:string ->
?keep_nl_params:[ `All | `Persistent | `None ] ->
?nl_params:Eliom_parameter.nl_params_set ->
?xhr:bool ->
'a H.elt list ->
'get ->
[> 'a Html_types.a ] H.eltThe function a service a_content get_params creates a <a> node that link to service applied to GET parameters get_params and whose content is a_content. By default, the href attribute is a relative URL recomputed at each request with make_uri.
By default, the link is implemented in a way that allows the client-side Eliom application to keep running, irrespectable of the usage of the link (cf. <<a_api project="eliom"
subproject="client" | val Eliom_client.change_page>> ).
By contrast, if the optional parameter ~xhr:false is given, the link is realized as a standard HTML link and clicking it discontinues the Eliom application. The ~xhr parameter has no effect outside an Eliom application. The default value of ~xhr is configurable through <<a_api project="eliom" subproject="server" | val
Eliom_config.set_default_links_xhr >> .
The optional parameter ~a allows one to add extra HTML attributes to the generated node.
See make_uri for description of other optional parameters.
To create a <a> node that is not associated to a service, use Raw.a.