Aha. So you recommend every EmbperlObject file from my example looks
like
==================================
[$ sub title $]Test 1[$ endsub $]
[$ sub bgcolor $]#ff0000[$ endsub $]
[$ sub copyright $]1[$ endsub $]
<p>Test page</p>
I guess it's usable but I'd like better something like
==================================
[- setparams title => "Test", bgcolor => "#ff0000", copyright => 1 -]
<p>Test page</p>
Anyway, several [$sub$]'s in every file, what about performance (vs.
some kind of sending around param list/hash)? Moreover, how would you
set up defaults? Can I have
[$ sub bgcolor $]some default background color[$ endsub $]
in the base.html and then redefine it in the EmbperlObject files as/when
needed?
- Robert
Gerald Richter wrote:
>
> >
> > one more question: any plan to parameters for components? Here's
> > exactly what I mean:
> >
> >
> > base.html
> > ==================================
> > <html>
> > <head>
> > <title>[+ $param{title} +]</title>
> > </head>
> > <body bgcolor=[+ $param{bgcolor} +]>
> > <h1>[+ $param{title} +]</h1>
> > [- Execute ('*') -]
> > </body>
> > </html>
> >
>
> Rewrite it as
>
> <title>[- Execute ('*#title') -]</title>
>
> and put a
>
> Execute (filename => '*', 'import' => 0') ;
>
> at the top of base.html (this line is only neccessary for now, it will be
> automaticly executed in the next release)
>
> your test.html defines
>
> [$sub title $] My Title goes here [$endsub$]
>
> >
> > P.S. When I read about first EmbperlObject, I jumped two meters, because
> > it's exactly what I need. Well, it doesn't work offline, but isn't very
> > urgent and I may find the courage to patch it myself eventually. But
> > parameters for components are quite necessary for all other my projects,
> > without them, I'd still have to start every file with
> >
>
> I think calling subs like a I describe above should serve the same purpose,
> doesn't they? I surely will extent EmbperlObject in the future, to have more
> and better possibilities.
>
> Gerald
>
> >
> > P.S. Isn't it slowly becoming more like EmbperlTemplate? ;-)
> >
>
> Embperl 2 will become much more ;-)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]