module MakeForms:functor (
Pages
:
FORMCREATE
) ->
ELIOMFORMSIG
with type form_content_elt = Pages.form_content_elt and type form_content_elt_list = Pages.form_content_elt_list and type form_elt = Pages.form_elt and type a_content_elt = Pages.a_content_elt and type a_content_elt_list = Pages.a_content_elt_list and type a_elt = Pages.a_elt and type a_elt_list = Pages.a_elt_list and type div_content_elt = Pages.div_content_elt and type div_content_elt_list = Pages.div_content_elt_list and type uri = Pages.uri and type link_elt = Pages.link_elt and type script_elt = Pages.script_elt and type textarea_elt = Pages.textarea_elt and type input_elt = Pages.input_elt and type pcdata_elt = Pages.pcdata_elt and type select_elt = Pages.select_elt and type select_content_elt = Pages.select_content_elt and type select_content_elt_list = Pages.select_content_elt_list and type button_elt = Pages.button_elt and type button_content_elt = Pages.button_content_elt and type button_content_elt_list = Pages.button_content_elt_list and type option_elt = Pages.option_elt and type option_elt_list = Pages.option_elt_list and type a_attrib_t = Pages.a_attrib_t and type form_attrib_t = Pages.form_attrib_t and type input_attrib_t = Pages.input_attrib_t and type textarea_attrib_t = Pages.textarea_attrib_t and type select_attrib_t = Pages.select_attrib_t and type link_attrib_t = Pages.link_attrib_t and type script_attrib_t = Pages.script_attrib_t and type optgroup_attrib_t = Pages.optgroup_attrib_t and type option_attrib_t = Pages.option_attrib_t and type button_attrib_t = Pages.button_attrib_t and type input_type_t = Pages.input_type_t and type button_type_t = Pages.button_type_t
Parameters: |
|
type
form_content_elt
type
form_content_elt_list
type
form_elt
type
a_content_elt
type
a_content_elt_list
type
a_elt
type
a_elt_list
type
div_content_elt
type
div_content_elt_list
type
uri
type
link_elt
type
script_elt
type
textarea_elt
type
input_elt
type
pcdata_elt
type
select_elt
type
select_content_elt
type
select_content_elt_list
type
option_elt
type
option_elt_list
type
a_attrib_t
type
form_attrib_t
type
input_attrib_t
type
textarea_attrib_t
type
select_attrib_t
type
link_attrib_t
type
script_attrib_t
type
optgroup_attrib_t
type
option_attrib_t
type
input_type_t
val make_string_uri : ?absolute:bool ->
?absolute_path:bool ->
?https:bool ->
service:('a, unit, [< Eliom_services.get_service_kind ],
[< Eliom_services.suff ], 'b, unit, [< Eliom_services.registrable ])
Eliom_services.service ->
sp:Eliom_sessions.server_params ->
?hostname:string ->
?port:int ->
?fragment:string ->
?keep_nl_params:[ `All | `None | `Persistent ] ->
?nl_params:Eliom_parameters.nl_params_set -> 'a -> string
If absolute
is set to true
, or if there is a protocol change,
the URL will be absolute.
If absolute_path
is set to true
, and absolute
is false
,
the URL will be absolute, but without protocol://server:port
.
Default hostname is determined from the Host
http header of the request
(or the attribute of <host> tag in
configuration file if the option <usedefaulthostname/>
is set).
Default port is the current port (or another port of the server if
you are switching from or to https).
But you can choose the hostname or port you want by setting
the optional ?hostname
and ?port
parameters here.
val make_uri : ?absolute:bool ->
?absolute_path:bool ->
?https:bool ->
service:('a, unit, [< Eliom_services.get_service_kind ],
[< Eliom_services.suff ], 'b, unit, [< Eliom_services.registrable ])
Eliom_services.service ->
sp:Eliom_sessions.server_params ->
?hostname:string ->
?port:int ->
?fragment:string ->
?keep_nl_params:[ `All | `None | `Persistent ] ->
?nl_params:Eliom_parameters.nl_params_set ->
'a -> uri
a
function, it may take extra parameters.val make_uri_components : ?absolute:bool ->
?absolute_path:bool ->
?https:bool ->
service:('a, unit, [< Eliom_services.get_service_kind ],
[< Eliom_services.suff ], 'b, unit, [< Eliom_services.registrable ])
Eliom_services.service ->
sp:Eliom_sessions.server_params ->
?hostname:string ->
?port:int ->
?fragment:string ->
?keep_nl_params:[ `All | `None | `Persistent ] ->
?nl_params:Eliom_parameters.nl_params_set ->
'a -> string * (string * string) list * string option
a
function, it may take extra parameters.val make_post_uri_components : ?absolute:bool ->
?absolute_path:bool ->
?https:bool ->
service:('a, 'b, [< Eliom_services.post_service_kind ],
[< Eliom_services.suff ], 'c, 'd, [< Eliom_services.registrable ])
Eliom_services.service ->
sp:Eliom_sessions.server_params ->
?hostname:string ->
?port:int ->
?fragment:string ->
?keep_nl_params:[ `All | `None | `Persistent ] ->
?nl_params:Eliom_parameters.nl_params_set ->
?keep_get_na_params:bool ->
'a ->
'b ->
string * (string * string) list * string option * (string * string) list
make_uri_components
, but also creates a table of post parameters.val make_proto_prefix : sp:Eliom_sessions.server_params ->
?hostname:string -> ?port:int -> bool -> string
val a : ?absolute:bool ->
?absolute_path:bool ->
?https:bool ->
?a:a_attrib_t ->
service:('a, unit, [< Eliom_services.get_service_kind ],
[< Eliom_services.suff ], 'b, 'c, [< Eliom_services.registrable ])
Eliom_services.service ->
sp:Eliom_sessions.server_params ->
?hostname:string ->
?port:int ->
?fragment:string ->
?keep_nl_params:[ `All | `None | `Persistent ] ->
?nl_params:Eliom_parameters.nl_params_set ->
a_content_elt_list ->
'a -> a_elt
a service sp cont ()
creates a link to service
.
The text of
the link is cont
. For example cont
may be something like
[pcdata "click here"]
.
The last parameter is for GET parameters.
For example a service sp cont (42,"hello")
The ~a
optional parameter is used for extra attributes.
The ~fragment
optional parameter is used for the "fragment" part
of the URL, that is, the part after character "#".
When possible, all links generated by Eliom are relative, for example
to make easier the use with reverse proxies.
But in case of protocol change (if you want to switch to https using
~https:true
for example, or if the service imposes https),
absolute links will be generated.
In that case,
default hostname is determined from the Host
http header of the request
(or the attribute of <host> tag in
configuration file if the option <usedefaulthostname/>
is set).
Default port is the current port (or another port of the server if
you are switching from or to https).
But you can choose the hostname or port you want by setting
the optional ?hostname
and ?port
parameters here.
These options have no effect for relative links.
You can add non-localized parameters using the optional parameter
nl_params
. See Eliom_parameters.nl_params_set
.
If ~keep_nl_params
is `Persistent
(resp. `All
),
persistent (resp all) non localized GET parameters
will be kept in the URL (default is the default for the service).
val css_link : ?a:link_attrib_t ->
uri:uri ->
unit -> link_elt
<link>
tag for a Cascading StyleSheet (CSS).val js_script : ?a:script_attrib_t ->
uri:uri ->
unit -> script_elt
<script>
tag to add a javascript fileval get_form : ?absolute:bool ->
?absolute_path:bool ->
?https:bool ->
?a:form_attrib_t ->
service:('a, unit, [< Eliom_services.get_service_kind ],
[< Eliom_services.suff ], 'b, 'c, [< Eliom_services.registrable ])
Eliom_services.service ->
sp:Eliom_sessions.server_params ->
?hostname:string ->
?port:int ->
?fragment:string ->
?keep_nl_params:[ `All | `None | `Persistent ] ->
?nl_params:Eliom_parameters.nl_params_set ->
('b -> form_content_elt_list) ->
form_elt
get_form service sp formgen
creates a GET form to service
.
The content of
the form is generated by the function formgen
, that takes the names
of the service parameters as parameters.val lwt_get_form : ?absolute:bool ->
?absolute_path:bool ->
?https:bool ->
?a:form_attrib_t ->
service:('a, unit, [< Eliom_services.get_service_kind ],
[< Eliom_services.suff ], 'b, 'c, [< Eliom_services.registrable ])
Eliom_services.service ->
sp:Eliom_sessions.server_params ->
?hostname:string ->
?port:int ->
?fragment:string ->
?keep_nl_params:[ `All | `None | `Persistent ] ->
?nl_params:Eliom_parameters.nl_params_set ->
('b -> form_content_elt_list Lwt.t) ->
form_elt Lwt.t
val post_form : ?absolute:bool ->
?absolute_path:bool ->
?https:bool ->
?a:form_attrib_t ->
service:('a, 'b, [< Eliom_services.post_service_kind ],
[< Eliom_services.suff ], 'c, 'd, [< Eliom_services.registrable ])
Eliom_services.service ->
sp:Eliom_sessions.server_params ->
?hostname:string ->
?port:int ->
?fragment:string ->
?keep_nl_params:[ `All | `None | `Persistent ] ->
?keep_get_na_params:bool ->
?nl_params:Eliom_parameters.nl_params_set ->
('d -> form_content_elt_list) ->
'a -> form_elt
post_form service sp formgen
creates a POST form to service
.
The last parameter is for GET parameters (as in the function a
).
If ~keep_nl_params
is `Persistent
(resp. `All
),
persistent (resp all) non localized GET parameters
will be kept in the URL (default is the default for the service).
val lwt_post_form : ?absolute:bool ->
?absolute_path:bool ->
?https:bool ->
?a:form_attrib_t ->
service:('a, 'b, [< Eliom_services.post_service_kind ],
[< Eliom_services.suff ], 'c, 'd, [< Eliom_services.registrable ])
Eliom_services.service ->
sp:Eliom_sessions.server_params ->
?hostname:string ->
?port:int ->
?fragment:string ->
?keep_nl_params:[ `All | `None | `Persistent ] ->
?keep_get_na_params:bool ->
?nl_params:Eliom_parameters.nl_params_set ->
('d -> form_content_elt_list Lwt.t) ->
'a -> form_elt Lwt.t
val int_input : ?a:input_attrib_t ->
input_type:input_type_t ->
?name:[< int Eliom_parameters.setoneradio ] Eliom_parameters.param_name ->
?value:int -> unit -> input_elt
<input>
tag for an integerval int32_input : ?a:input_attrib_t ->
input_type:input_type_t ->
?name:[< int32 Eliom_parameters.setoneradio ] Eliom_parameters.param_name ->
?value:int32 -> unit -> input_elt
<input>
tag for an integerval int64_input : ?a:input_attrib_t ->
input_type:input_type_t ->
?name:[< int64 Eliom_parameters.setoneradio ] Eliom_parameters.param_name ->
?value:int64 -> unit -> input_elt
<input>
tag for an integerval float_input : ?a:input_attrib_t ->
input_type:input_type_t ->
?name:[< float Eliom_parameters.setoneradio ] Eliom_parameters.param_name ->
?value:float -> unit -> input_elt
<input>
tag for a floatval string_input : ?a:input_attrib_t ->
input_type:input_type_t ->
?name:[< string Eliom_parameters.setoneradio ] Eliom_parameters.param_name ->
?value:string -> unit -> input_elt
<input>
tag for a stringval user_type_input : ('a -> string) ->
?a:input_attrib_t ->
input_type:input_type_t ->
?name:[< 'a Eliom_parameters.setoneradio ] Eliom_parameters.param_name ->
?value:'a -> unit -> input_elt
<input>
tag for a user typeval raw_input : ?a:input_attrib_t ->
input_type:input_type_t ->
?name:string -> ?value:string -> unit -> input_elt
<input>
tag. You may use the name you want
(for example to use with Eliom_parameters.any
).val file_input : ?a:input_attrib_t ->
name:[< Ocsigen_lib.file_info Eliom_parameters.setoneradio ]
Eliom_parameters.param_name ->
unit -> input_elt
<input>
tag for sending a fileval image_input : ?a:input_attrib_t ->
name:[< Eliom_parameters.coordinates Eliom_parameters.oneradio ]
Eliom_parameters.param_name ->
?src:uri ->
unit -> input_elt
<input type="image" name="...">
tag that sends the coordinates
the user clicked onval int_image_input : ?a:input_attrib_t ->
name:[< (int * Eliom_parameters.coordinates) Eliom_parameters.oneradio ]
Eliom_parameters.param_name ->
value:int ->
?src:uri ->
unit -> input_elt
<input type="image" name="..." value="...">
tag that sends
the coordinates the user clicked on and a value of type intval int32_image_input : ?a:input_attrib_t ->
name:[< (int32 * Eliom_parameters.coordinates) Eliom_parameters.oneradio ]
Eliom_parameters.param_name ->
value:int32 ->
?src:uri ->
unit -> input_elt
<input type="image" name="..." value="...">
tag that sends
the coordinates the user clicked on and a value of type int32val int64_image_input : ?a:input_attrib_t ->
name:[< (int64 * Eliom_parameters.coordinates) Eliom_parameters.oneradio ]
Eliom_parameters.param_name ->
value:int64 ->
?src:uri ->
unit -> input_elt
<input type="image" name="..." value="...">
tag that sends
the coordinates the user clicked on and a value of type int64val float_image_input : ?a:input_attrib_t ->
name:[< (float * Eliom_parameters.coordinates) Eliom_parameters.oneradio ]
Eliom_parameters.param_name ->
value:float ->
?src:uri ->
unit -> input_elt
<input type="image" name="..." value="...">
tag that sends
the coordinates the user clicked on and a value of type floatval string_image_input : ?a:input_attrib_t ->
name:[< (string * Eliom_parameters.coordinates) Eliom_parameters.oneradio ]
Eliom_parameters.param_name ->
value:string ->
?src:uri ->
unit -> input_elt
<input type="image" name="..." value="...">
tag that sends
the coordinates the user clicked on and a value of type stringval user_type_image_input : ('a -> string) ->
?a:input_attrib_t ->
name:[< ('a * Eliom_parameters.coordinates) Eliom_parameters.oneradio ]
Eliom_parameters.param_name ->
value:'a ->
?src:uri ->
unit -> input_elt
<input type="image" name="..." value="...">
tag that sends
the coordinates the user clicked on and a value of user defined typeval raw_image_input : ?a:input_attrib_t ->
name:string ->
value:string ->
?src:uri ->
unit -> input_elt
<input type="image" name="..." value="...">
tag that sends
the coordinates the user clicked on and an untyped valueval bool_checkbox : ?a:input_attrib_t ->
?checked:bool ->
name:[ `One of bool ] Eliom_parameters.param_name ->
unit -> input_elt
<input>
tag that will have a boolean value.
The service must declare a bool
parameter.val int_checkbox : ?a:input_attrib_t ->
?checked:bool ->
name:[ `Set of int ] Eliom_parameters.param_name ->
value:int -> unit -> input_elt
<input>
tag that will have an int value.
Thus you can do several checkboxes with the same name
(and different values).
The service must declare a parameter of type set
.val int32_checkbox : ?a:input_attrib_t ->
?checked:bool ->
name:[ `Set of int32 ] Eliom_parameters.param_name ->
value:int32 -> unit -> input_elt
<input>
tag that will have an int32 value.
Thus you can do several checkboxes with the same name
(and different values).
The service must declare a parameter of type set
.val int64_checkbox : ?a:input_attrib_t ->
?checked:bool ->
name:[ `Set of int64 ] Eliom_parameters.param_name ->
value:int64 -> unit -> input_elt
<input>
tag that will have an int64 value.
Thus you can do several checkboxes with the same name
(and different values).
The service must declare a parameter of type set
.val float_checkbox : ?a:input_attrib_t ->
?checked:bool ->
name:[ `Set of float ] Eliom_parameters.param_name ->
value:float -> unit -> input_elt
<input>
tag that will have a float value.
Thus you can do several checkboxes with the same name
(and different values).
The service must declare a parameter of type set
.val string_checkbox : ?a:input_attrib_t ->
?checked:bool ->
name:[ `Set of string ] Eliom_parameters.param_name ->
value:string -> unit -> input_elt
<input>
tag that will have a string value.
Thus you can do several checkboxes with the same name
(and different values).
The service must declare a parameter of type set
.val user_type_checkbox : ('a -> string) ->
?a:input_attrib_t ->
?checked:bool ->
name:[ `Set of 'a ] Eliom_parameters.param_name ->
value:'a -> unit -> input_elt
<input>
tag that will have a "user type" value.
Thus you can do several checkboxes with the same name
(and different values).
The service must declare a parameter of type set
.val raw_checkbox : ?a:input_attrib_t ->
?checked:bool ->
name:string -> value:string -> unit -> input_elt
<input>
tag with untyped content.
Thus you can do several checkboxes with the same name
(and different values).
The service must declare a parameter of type any
.val string_radio : ?a:input_attrib_t ->
?checked:bool ->
name:[ `Radio of string ] Eliom_parameters.param_name ->
value:string -> unit -> input_elt
<input>
tag with string contentval int_radio : ?a:input_attrib_t ->
?checked:bool ->
name:[ `Radio of int ] Eliom_parameters.param_name ->
value:int -> unit -> input_elt
<input>
tag with int contentval int32_radio : ?a:input_attrib_t ->
?checked:bool ->
name:[ `Radio of int32 ] Eliom_parameters.param_name ->
value:int32 -> unit -> input_elt
<input>
tag with int32 contentval int64_radio : ?a:input_attrib_t ->
?checked:bool ->
name:[ `Radio of int64 ] Eliom_parameters.param_name ->
value:int64 -> unit -> input_elt
<input>
tag with int64 contentval float_radio : ?a:input_attrib_t ->
?checked:bool ->
name:[ `Radio of float ] Eliom_parameters.param_name ->
value:float -> unit -> input_elt
<input>
tag with float contentval user_type_radio : ('a -> string) ->
?a:input_attrib_t ->
?checked:bool ->
name:[ `Radio of 'a ] Eliom_parameters.param_name ->
value:'a -> unit -> input_elt
<input>
tag with user_type contentval raw_radio : ?a:input_attrib_t ->
?checked:bool ->
name:string -> value:string -> unit -> input_elt
<input>
tag with untyped string content (low level)?a:button_attrib_t ->
name:[< string Eliom_parameters.setone ] Eliom_parameters.param_name ->
value:string ->
button_content_elt_list ->
button_elt
: <button>
tag with string content?a:button_attrib_t ->
name:[< int Eliom_parameters.setone ] Eliom_parameters.param_name ->
value:int ->
button_content_elt_list ->
button_elt
: <button>
tag with int content?a:button_attrib_t ->
name:[< int32 Eliom_parameters.setone ] Eliom_parameters.param_name ->
value:int32 ->
button_content_elt_list ->
button_elt
: <button>
tag with int32 content?a:button_attrib_t ->
name:[< int64 Eliom_parameters.setone ] Eliom_parameters.param_name ->
value:int64 ->
button_content_elt_list ->
button_elt
: <button>
tag with int64 content?a:button_attrib_t ->
name:[< float Eliom_parameters.setone ] Eliom_parameters.param_name ->
value:float ->
button_content_elt_list ->
button_elt
: <button>
tag with float content('a -> string) ->
?a:button_attrib_t ->
name:[< 'a Eliom_parameters.setone ] Eliom_parameters.param_name ->
value:'a ->
button_content_elt_list ->
button_elt
: <button>
tag with user_type content?a:button_attrib_t ->
button_type:button_type_t ->
name:string ->
value:string ->
button_content_elt_list ->
button_elt
: <button>
tag with untyped string content?a:button_attrib_t ->
button_type:button_type_t ->
button_content_elt_list ->
button_elt
: <button>
tag with no value. No value is sent.val textarea : ?a:textarea_attrib_t ->
name:[< string Eliom_parameters.setoneradio ] Eliom_parameters.param_name ->
?value:string ->
rows:int -> cols:int -> unit -> textarea_elt
<textarea>
tagval raw_textarea : ?a:textarea_attrib_t ->
name:string ->
?value:string ->
rows:int -> cols:int -> unit -> textarea_elt
<textarea>
tag for untyped formtype'a
soption =option_attrib_t * 'a *
pcdata_elt option * bool
type 'a
select_opt =
| |
Optgroup of |
| |
Option of |
<select>
options and groups of options.soption
is the value that will be sent
by the form.pcdata elt option
is not present it is also the
value displayed.select_opt
is the labelval raw_select : ?a:select_attrib_t ->
name:string ->
string select_opt ->
string select_opt list ->
select_elt
<select>
tag for any (untyped) value.val int_select : ?a:select_attrib_t ->
name:[< `One of int ] Eliom_parameters.param_name ->
int select_opt ->
int select_opt list ->
select_elt
<select>
tag for int values.val int32_select : ?a:select_attrib_t ->
name:[< `One of int32 ] Eliom_parameters.param_name ->
int32 select_opt ->
int32 select_opt list ->
select_elt
<select>
tag for int32 values.val int64_select : ?a:select_attrib_t ->
name:[< `One of int64 ] Eliom_parameters.param_name ->
int64 select_opt ->
int64 select_opt list ->
select_elt
<select>
tag for int64 values.val float_select : ?a:select_attrib_t ->
name:[< `One of float ] Eliom_parameters.param_name ->
float select_opt ->
float select_opt list ->
select_elt
<select>
tag for float values.val string_select : ?a:select_attrib_t ->
name:[< `One of string ] Eliom_parameters.param_name ->
string select_opt ->
string select_opt list ->
select_elt
<select>
tag for string values.val user_type_select : ('a -> string) ->
?a:select_attrib_t ->
name:[< `One of 'a ] Eliom_parameters.param_name ->
'a select_opt ->
'a select_opt list ->
select_elt
<select>
tag for user type values.val raw_multiple_select : ?a:select_attrib_t ->
name:string ->
string select_opt ->
string select_opt list ->
select_elt
<select>
tag for any (untyped) value.val int_multiple_select : ?a:select_attrib_t ->
name:[< `Set of int ] Eliom_parameters.param_name ->
int select_opt ->
int select_opt list ->
select_elt
<select>
tag for int values.val int32_multiple_select : ?a:select_attrib_t ->
name:[< `Set of int32 ] Eliom_parameters.param_name ->
int32 select_opt ->
int32 select_opt list ->
select_elt
<select>
tag for int32 values.val int64_multiple_select : ?a:select_attrib_t ->
name:[< `Set of int64 ] Eliom_parameters.param_name ->
int64 select_opt ->
int64 select_opt list ->
select_elt
<select>
tag for int64 values.val float_multiple_select : ?a:select_attrib_t ->
name:[< `Set of float ] Eliom_parameters.param_name ->
float select_opt ->
float select_opt list ->
select_elt
<select>
tag for float values.val string_multiple_select : ?a:select_attrib_t ->
name:[< `Set of string ] Eliom_parameters.param_name ->
string select_opt ->
string select_opt list ->
select_elt
<select>
tag for string values.val user_type_multiple_select : ('a -> string) ->
?a:select_attrib_t ->
name:[< `Set of 'a ] Eliom_parameters.param_name ->
'a select_opt ->
'a select_opt list ->
select_elt
<select>
tag for user type values.