For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > September 2004 > Re: [SMARTY] Variables with dots in templates









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] Variables with dots in templates
Robert Amos

2004-09-06, 4:03 pm

Maybe use something like:

{if array_key_exists('utenti_servizi.tipo_abbonamento', $cb_src)}

not quite identical to using isset(),see
http://php.net/array_key_exists for more info.

-bok


On Mon, 6 Sep 2004 17:35:37 +0200, Valerio Santinelli
<tanis@altralogica.it> wrote:
> I guess I stumbled on a problem I cannot solve by myself.
>
> In my HTML template I have a form with check boxes like:
>
> <input name="cb_src[]" type="checkbox" class="ricerca" id="cb_src[]"
> value="utenti_servizi.tipo_abbonamento" {if
> (isset($cb_src.utenti_servizi.tipo_abbonamento))}checked{/if}>
>
> My problem is that $cb_src.utenti_servizi.tipo_abbonamento is never going to
> be set because the real variable in php is
> $cb_src['utenti_servizi.tipo_abbonamento']
> I gues that having a dot in a key of an array makes a problem for Smarty
> unless there's some other way to overcome the problem.
>
> Is there anybody who can help me?
>
> Valerio Santinelli
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com