[Zope] Composing variables

Cristi Barladeanu kristache at gmail.com
Fri Jul 29 12:02:43 EDT 2005


Hello Andreas and thank for your answer. I've posted this question to 
at-users
list too but still no answer. In fact this problem is not related only to 
AT. Let me 
give you an example:

var alternative = 'bar' or 'baz'
var foo_baz = 'content based on baz'
var foo_bar = 'content based on bar'

These can be defined either in ZPT, DTML or Python Script. The problem is 
the same.
The question is how can I obtain the value of foo_$alternative.

An example written in PHP:

$alternative = "bar";
$foo_bar = "content based on bar";
echo ${"foo_".$alternative} 

This will produce "content based on bar".

Thanks for your time,
Cristi

On 7/28/05, Andreas Jung <lists at andreas-jung.com> wrote:
> 
> 
> 
> --On 28. Juli 2005 11:59:09 +0300 Cristi Barladeanu <kristache at gmail.com>
> wrote:
> 
> > Good day everyone
> >
> > I've defined some archetypes that contain fields like Title_en, 
> Title_de,
> > Content_en, Content_de, etc.
> > Assuming that I've set a language var related to URL like (lang = 'en'),
> > how can i access them?
> >
> 
> Please ask AT related questions on the at-users list. In general you 
> should
> not access attributes in AT directly but only through the accessor 
> methods.
> There is something like getField(fieldname) in the AT which might help you
> (look also at the AT docs).
> 
> -aj
> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20050729/7f4f39a6/attachment.htm


More information about the Zope mailing list