package eliom
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=218bcb5cd275cc05be06574c5fa357fa
sha512=edbf8b084ec1b7439d4715199c22eb925a77a2dcfbe76bb5bbc4b9d076b70be1b0de74f9eab9dfb7854df28d65eb31a4c17380528d4a461d9c2a4222abe804cc
doc/eliom.server/Eliom_registration/Eliom_tmpl/argument-1-App/index.html
Parameter Eliom_tmpl.App
val application_script :
?defer:bool ->
?async:bool ->
unit ->
[> `Script ] Eliom_content.Html.eltThe function application_name () returns a <script> node that represents the javascript part of the application. If you do not include this script in the <head> node of your page, it will be automatically added at the end of the <head> node.
Unique identifier for this application. Currently, it is just the application name as defined by Appl_params.application_name.
Warning: do not mix up with the "application instance id", that is unique for each instance of the application on a client.
Checks during a request whether it is the initial request of the client process in this Eliom application.
The type appl is an abstract type for identifying an application. It usually used a phantom parameter for application_content.
include Eliom_registration_sigs.S_with_create
with type page = Html_types.html Eliom_content.Html.elt
and type options = appl_service_options
and type return = Eliom_service.non_ocaml
and type result = app_id application_content kind
include Eliom_registration_sigs.S
with type page = Html_types.html Eliom_content.Html.elt
with type options = appl_service_options
with type return = Eliom_service.non_ocaml
with type result = app_id application_content kind
type page = Html_types.html Eliom_content.Html.elttype options = appl_service_optionstype return = Eliom_service.non_ocamltype result = app_id application_content kindService registration
val register :
?app:string ->
?scope:[< Eliom_common.scope ] ->
?options:options ->
?charset:string ->
?code:int ->
?content_type:string ->
?headers:Cohttp.Header.t ->
?secure_session:bool ->
service:
('get,
'post,
_,
_,
_,
Eliom_service.non_ext,
Eliom_service.reg,
_,
_,
_,
return)
Eliom_service.t ->
?error_handler:((string * exn) list -> page Lwt.t) ->
('get -> 'post -> page Lwt.t) ->
unitThe function register ~service handler associates the service to the function handler. The handler function takes two parameters, the GET and POST parameters of the current HTTP request, and should return the corresponding page.
The optional parameter ~scope is Eliom_common.global_scope by default. See the Eliom manual for detailed description
<<a_manual chapter="server-services" fragment="scope"|of
different scopes>>.
The optional parameter ~options is specific to each output module. See the type description for more information.
The optional parameters ?charset, ?code, ?content_type and ?headers can be used to modify the HTTP answer sent by Eliom. Use this with care.
The optional parameter ~secure_session has no effect for scope Eliom_common.global_scope. With other scopes, the parameter is used to force the session service table in which the handler will be registered. By default, the service is registered in the non-secure session if the current request's protocol is http, or in the secure session if the protocol is https. If set to false (resp. true) the handler will be stored in the non-secure (resp. secure) session. See the Eliom manual for an introduction to <<a_manual
chapter="server-state"|secure state>>.
The optional parameter ~error_handler is used to specialize the error page when actual parameters aren't compatible with the expected type. The default error handler is fun l -> raise (Eliom_common.Eliom_Typing_Error l) .
val send :
?options:options ->
?charset:string ->
?code:int ->
?content_type:string ->
?headers:Cohttp.Header.t ->
page ->
result Lwt.tThe function send page builds the HTTP frame corresponding to page. This may be used for example in a service handler registered with Eliom_registration.Any.register, or when building a custom output module.
val create :
?app:string ->
?scope:[< Eliom_common.scope ] ->
?options:options ->
?charset:string ->
?code:int ->
?content_type:string ->
?headers:Cohttp.Header.t ->
?secure_session:bool ->
?https:bool ->
?name:string ->
?csrf_safe:bool ->
?csrf_scope:[< Eliom_common.user_scope ] ->
?csrf_secure:bool ->
?max_use:int ->
?timeout:float ->
meth:('m, 'gp, 'gn, 'pp, 'pn, 'tipo, 'gp_) Eliom_service.meth ->
path:('att, 'co, 'gp_) Eliom_service.path_option ->
?error_handler:((string * exn) list -> page Lwt.t) ->
('gp -> 'pp -> page Lwt.t) ->
('gp,
'pp,
'm,
'att,
'co,
Eliom_service.non_ext,
Eliom_service.reg,
'tipo,
'gn,
'pn,
return)
Eliom_service.tCreate a service and register it at the same time. It calls Eliom_service.create and then performs Eliom_registration_sigs.S.register. Returns the service.
val create_attached_get :
?app:string ->
?scope:[< Eliom_common.scope ] ->
?options:options ->
?charset:string ->
?code:int ->
?content_type:string ->
?headers:Cohttp.Header.t ->
?secure_session:bool ->
?https:bool ->
?name:string ->
?csrf_safe:bool ->
?csrf_scope:[< Eliom_common.user_scope ] ->
?csrf_secure:bool ->
?max_use:int ->
?timeout:float ->
fallback:
(unit,
unit,
Eliom_service.get,
Eliom_service.att,
Eliom_service.non_co,
Eliom_service.non_ext,
_,
[ `WithoutSuffix ],
unit,
unit,
return)
Eliom_service.t ->
get_params:('gp, [ `WithoutSuffix ], 'gn) Eliom_parameter.params_type ->
?error_handler:((string * exn) list -> page Lwt.t) ->
('gp -> unit -> page Lwt.t) ->
('gp,
unit,
Eliom_service.get,
Eliom_service.att,
Eliom_service.co,
Eliom_service.non_ext,
Eliom_service.reg,
[ `WithoutSuffix ],
'gn,
unit,
return)
Eliom_service.tCreate an attached service and register it at the same time. It calls Eliom_service.create_attached_get and then performs Eliom_registration_sigs.S.register. Returns the new service.
val create_attached_post :
?app:string ->
?scope:[< Eliom_common.scope ] ->
?options:options ->
?charset:string ->
?code:int ->
?content_type:string ->
?headers:Cohttp.Header.t ->
?secure_session:bool ->
?https:bool ->
?name:string ->
?csrf_safe:bool ->
?csrf_scope:[< Eliom_common.user_scope ] ->
?csrf_secure:bool ->
?max_use:int ->
?timeout:float ->
fallback:
('gp,
unit,
Eliom_service.get,
Eliom_service.att,
Eliom_service.non_co,
Eliom_service.non_ext,
_,
[ `WithoutSuffix ],
'gn,
unit,
return)
Eliom_service.t ->
post_params:('pp, [ `WithoutSuffix ], 'pn) Eliom_parameter.params_type ->
?error_handler:((string * exn) list -> page Lwt.t) ->
('gp -> 'pp -> page Lwt.t) ->
('gp,
'pp,
Eliom_service.post,
Eliom_service.att,
Eliom_service.co,
Eliom_service.non_ext,
Eliom_service.reg,
[ `WithoutSuffix ],
'gn,
'pn,
return)
Eliom_service.tCreate an attached POST service and register it at the same time. It calls Eliom_service.create_attached_post and then performs Eliom_registration_sigs.S.register. Returns the new service.