English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Help with Elliom syntax
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-11-04 (12:31)
From: Sylvain Le Gall <sylvain@l...>
Subject: Re: Help with Elliom syntax

On 04-11-2010, Till Crueger <Till.Crueger@gmx.net> wrote:
> Hi,
> I am still trying to find my way with Elliom and Ocsigen. Right now I can  
> use OCaml to generate the pages I want, but I still have problems to  
> figure out how to encode the XHTML. The main question I have is how to  
> assign attributes to elements,
> like div blocks or others. I found the a_id functions that should return  
> an id object, but I have not figured out how to use it to actually assign  
> the id.

Most of the time you have an ~a parameter.

div ~a:[a_class ["statistics"]] [ h2 [pcdata "Statistics"]; ... ]

Sylvain Le Gall