Skip to content

Commit

Permalink
Deploying to gh-pages from @ 6080273 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
balat committed Feb 9, 2024
1 parent 52fb250 commit 625325a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
15 changes: 8 additions & 7 deletions 7.1/manual/basics-server.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,15 @@
above, plus one POST parameter of type string, named "mypostparam".
</p><pre class="server" class=""><code class="language-ocaml translatable">~meth:(Eliom_service.Post (Eliom_parameter.((string &quot;s&quot; ** int &quot;i&quot;),
(string &quot;mypostparam&quot;))))</code></pre></section><section class="docblock"><header><h2>Eliom: Other kinds of services</h2></header><h3>Pathless services</h3><p>Pathless services are not identified by the path in the URL,
but by a name given as parameter. This name can be specified manually
but by a name given as parameter, regardless of the path.
Use this to make a functionality available from all pages
(for example: log-in or log-out actions, add something in a shopping basket ...).
The name can be specified manually
using the <span class="teletype">~name</span> optional parameter, otherwise, a random name is
generated automatically.
This is used to implement server functions (see below).
If you are programming a client-server Eliom app, you will probably prefer server functions.
If you are using traditional service based Web programming,
use this to make a functionality available from all pages
(for example: log-in or log-out actions, add something in a shopping basket ...).
This is also used to implement server functions (see below).
If you are programming a client-server Eliom app, you will often prefer
remote procedure calls (`let%rpc`).
</p><pre class="server" class=""><code class="language-ocaml translatable">let pathless_service =
Eliom_service.create
~name:&quot;pathless_example&quot;
Expand Down Expand Up @@ -311,7 +312,7 @@
</p><p>The following Eliom reference will count the number of visits of a user on a page:
</p><pre class="server" class=""><code class="language-ocaml translatable">let%server count_ref =
Eliom_reference.eref
~scope:Eliom_common.session
~scope:Eliom_common.default_session_scope
0 (* default value for everyone *)</code></pre><p>And somewhere in your service handler, increment the counter:
</p><pre class="server" class=""><code class="language-ocaml translatable">let%lwt count = Eliom_reference.get count_ref in
Eliom_reference.set count_ref (count + 1);
Expand Down
2 changes: 1 addition & 1 deletion 7.1/manual/basics.html
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@
</p><p>The following Eliom reference will count the number of visits of a user on a page:
</p><pre class="server" class=""><code class="language-ocaml translatable">let%server count_ref =
Eliom_reference.eref
~scope:Eliom_common.session
~scope:Eliom_common.default_session_scope
0 (* default value for everyone *)</code></pre><p>And somewhere in your service handler, increment the counter:
</p><pre class="server" class=""><code class="language-ocaml translatable">let%lwt count = Eliom_reference.get count_ref in
Eliom_reference.set count_ref (count + 1);
Expand Down
15 changes: 8 additions & 7 deletions dev/manual/basics-server.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,15 @@
above, plus one POST parameter of type string, named &quot;mypostparam&quot;.
</p><pre class="server" class=""><code class="language-ocaml translatable">~meth:(Eliom_service.Post (Eliom_parameter.((string &quot;s&quot; ** int &quot;i&quot;),
(string &quot;mypostparam&quot;))))</code></pre></section><section class="docblock"><header><h2>Eliom: Other kinds of services</h2></header><h3>Pathless services</h3><p>Pathless services are not identified by the path in the URL,
but by a name given as parameter. This name can be specified manually
but by a name given as parameter, regardless of the path.
Use this to make a functionality available from all pages
(for example: log-in or log-out actions, add something in a shopping basket ...).
The name can be specified manually
using the <span class="teletype">~name</span> optional parameter, otherwise, a random name is
generated automatically.
This is used to implement server functions (see below).
If you are programming a client-server Eliom app, you will probably prefer server functions.
If you are using traditional service based Web programming,
use this to make a functionality available from all pages
(for example: log-in or log-out actions, add something in a shopping basket ...).
This is also used to implement server functions (see below).
If you are programming a client-server Eliom app, you will often prefer
remote procedure calls (`let%rpc`).
</p><pre class="server" class=""><code class="language-ocaml translatable">let pathless_service =
Eliom_service.create
~name:&quot;pathless_example&quot;
Expand Down Expand Up @@ -311,7 +312,7 @@
</p><p>The following Eliom reference will count the number of visits of a user on a page:
</p><pre class="server" class=""><code class="language-ocaml translatable">let%server count_ref =
Eliom_reference.eref
~scope:Eliom_common.session
~scope:Eliom_common.default_session_scope
0 (* default value for everyone *)</code></pre><p>And somewhere in your service handler, increment the counter:
</p><pre class="server" class=""><code class="language-ocaml translatable">let%lwt count = Eliom_reference.get count_ref in
Eliom_reference.set count_ref (count + 1);
Expand Down
2 changes: 1 addition & 1 deletion dev/manual/basics.html
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@
</p><p>The following Eliom reference will count the number of visits of a user on a page:
</p><pre class="server" class=""><code class="language-ocaml translatable">let%server count_ref =
Eliom_reference.eref
~scope:Eliom_common.session
~scope:Eliom_common.default_session_scope
0 (* default value for everyone *)</code></pre><p>And somewhere in your service handler, increment the counter:
</p><pre class="server" class=""><code class="language-ocaml translatable">let%lwt count = Eliom_reference.get count_ref in
Eliom_reference.set count_ref (count + 1);
Expand Down

0 comments on commit 625325a

Please sign in to comment.