List Info

Thread: how to acces array keys that start with '#'




how to acces array keys that start with '#'
user name
2007-04-05 04:22:02
The drupal programmers use a lot array keys that start with
'#' (e.g.
$field['#value'], $field['#weight'], $field['#description'],
...).
How can I access such array elements from within a smarty
template?

If I use {$field.#value} I get a smarty syntax error:
unrecognized tag.

Using {$field.'#value'} or {$field.[#value]} or
{$field.['#value']} doesn't work either. Do I have to escape
the # somehow?




		
___________________________________________________________

Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


Re: how to acces array keys that start with '#'
user name
2007-04-05 16:17:27
Have you tried $field['#value']?

Of if that fails:

{assign var='value' value='#value'}
{$field.$value}

Not pretty but should work.


Jörg Hermsdorf wrote:
> The drupal programmers use a lot array keys that start
with '#' (e.g.
> $field['#value'], $field['#weight'],
$field['#description'], ...).
> How can I access such array elements from within a
smarty template?
> 
> If I use {$field.#value} I get a smarty syntax error:
unrecognized tag.
> 
> Using {$field.'#value'} or {$field.[#value]} or
{$field.['#value']} doesn't work either. Do I have to escape
the # somehow?
> 
> 
> 
> 
> 		
>
___________________________________________________________

> Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )