NYCPHP Meetup

NYPHP.org

[nycphp-talk] Smart variable syntax question

Cliff Hirsch cliff at pinestream.com
Thu Nov 9 15:01:44 EST 2006


When I first got into this mess a year or two ago, your Smarty
presentation -- or was it class notes? -- was one of the first things I
ever read. You owe me -- is McSorely's still around?!

I ended up using Smarty assign to break it up a bit. Perhaps Smarty can
parse nesting, but I think a good rule of thumb may be that when the
human can't read it, don't expect the computer to be able to parse it.

I tend to hate to "flatten" data structures, as see it as unnecessary
data movement/swapping and performance hit to accommodate our feeble
minds, but I'm slowly learning that readability and maintainability is
often worth the hit.

Cliff

-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
On Behalf Of David Mintz
Sent: Thursday, November 09, 2006 2:43 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Smart variable syntax question


Jeez, I'm flattered but I'm no Smarty guru. Maybe the answer is "you
can't." At the risk of suggesting the obvious, any chance of breaking it
down into a less complex data structure at the PHP level, and assigning
that instead?

On Wed, 8 Nov 2006, Cliff Hirsch wrote:

> PHP equivalent: $params[0]->Contracts[$params[1]]['textkey']
>
> Smarty template: {$params[0]->Contracts.$params[1].textkey}
>
> This doesn't work. I can't figure out how to make the nested
->Contract
> [ $var[n]  } work in Smarty.
>
> Any ideas? David Mintz.hint, hint..

---
David Mintz
http://davidmintz.org/

En Nueva York el tránsito de la belleza a la desolación sucede
siempre expeditivamente, como si el principio universal
de máxima eficiencia hubiera aconsejado la supresión de
gradaciones intermedias.

  -- Antonio Muñoz Molina, Ventanas de Manhattan






More information about the talk mailing list