[Klone-users] More complex examples.

thomas fossati tho at koanlogic.com
Sun Dec 16 16:28:08 EST 2007


Hi Radek,

On Dec 16, 2007, at 6:54 PM, Radek wrote:
> What I'm interested in is:
>  * how to do something like page template.  I want to separate page
> design from page contents.  So I can change design without rewrite
> every page.

You can write a couple of .kl1 where you can put header (css refs) and 
footer stuff, then let all your "worker" pages include them via <%@ 
include "..." %> .

>  * how to write better "helper code" in separate libraries.  For
> instance I do not know how to access the out, session, requests page
> variables from helper libraries without passing them as arguments.

That's the way: 'request', 'response' and 'session' objects are only 
available in the .kl1 source ('out' can be popped out from the 
'response' via response_io()), so if you need to use them outside its 
scope they have to be passed as args.  Just remember to #include 
<klone/klone.h> in some top-level header of yours to allow the compiler 
to  handle them right.

>  * how to write a components I can use in pages.  I have something in
> my mind but didn't try to write it in code yet.

In a way a .kl1 is already a web component, pretty much like a java 
servlet ... what do you mean exactly ?

> This and many other, not yet formed, questions are reason I badly need
> how people do they things in KLone.

Thank you very much for your e-mail !  Hope that other will want to 
share what they have learned, the strategies and tactics they use to 
build their KLone-apps, so that we all can progress :)

ciao, t.





More information about the klone-users mailing list