2 * Copyright (C) 2005 Vincent Balat
3 * Laboratoire PPS - CNRS Université Paris Diderot
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation, with linking exception;
8 * either version 2.1 of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 ({{ <html xmlns
="http://www.w3.org/1999/xhtml">
36 <body
> [<h1
> "This page has been type checked by OcamlDuce"
40 (fun (number_name
,(number2_name
,string_name
)) ->
41 {{ [ <p
> [ 'Write an
int: '
42 {{ int_input ~input_type
:{{ "text" }} ~name
:number_name
() }}
44 {{ int_input ~input_type
:{{ "text" }} ~name
:number2_name
() }}
46 {{ string_input ~input_type
:{{ "text" }} ~name
:string_name
() }}
47 {{ string_input ~input_type
:{{ "submit" }} ~
value:"Click" ()}} ] ] }} )
49 let form = register_new_service
["form"] unit
51 let f = get_form
Tutoeliom.coucou_params sp
create_form in
53 {{ <html xmlns
="http://www.w3.org/1999/xhtml">
57 let links = register_new_service
["links"] unit
58 (fun sp
() () -> return
59 {{ <html xmlns
="http://www.w3.org/1999/xhtml">
63 [{{ a
s sp
{{ "first page" }} () }}
65 {{ a
form sp
{{ "form" }} () }}
67 (* {{ a s sp {{ "hello" }} () }}
70 {{ "coucou_params" }} (42,(22,"ciao")) }}
74 ~prefix
:"http://fr.wikipedia.org"
76 ~get_params
:(suffix
(string "a"))
79 {{ "ocaml on wikipedia" }}
85 let main = new_service ~path
:["radio"] ~get_params
:unit ()
87 new_post_service ~fallback
:main ~post_params
:(radio
string "test") ()
89 let gen_form = fun x
->
91 {: string_radio ~checked
:false ~name
:x ~
value:"Blerp" () :}
93 {: string_radio ~checked
:false ~name
:x ~
value:"Gnarf" () :}
95 {: string_input ~input_type
:{{ "submit" }} ~
value:"OK" () :}
99 register ~service
:main
101 return
{{ <html xmlns
="http://www.w3.org/1999/xhtml">[
102 <head
>[<title
>"Main"]
103 <body
>[{: post_form
form sp
gen_form () :}]
106 register ~service
:form
108 return
{{ <html xmlns
="http://www.w3.org/1999/xhtml">[
109 <head
>[<title
>"Form"]
110 <body
>[<p
>{: match x
with None
-> "Geen" | Some y
-> y
:}]
116 Eliom_duce.Blocks.register_new_service
121 ({: [ <h1
> "This page has been type checked by OcamlDuce"] :} ))