No problem.  Now that you have given us more information on the object
you were sending into the phptal template.

You don't need the define clause at all.

*<tal:block define="nst vanilla/nesting" condition="php: in_array(nst,
array('yui-gd', 'yui-gf'))">
*
could be changed to:

*<tal:block condition="php: in_array(vanilla['nesting'], array('yui-gd',
'yui-gf'))">

*So, to tie the other stuff together we talked about previously, can be
changed to this:

*<div id="content" class="class" tal:attributes="class php: (in_array(
vanilla['nesting'], array('yui-gc', 'yui-ge'))) ? 'yui-u first' : 'yui-u'"/>
*
Best regards,
Levi Stanley

Alister Cameron wrote:
> Sorry.
>
> Bit silly of me. I discovered after hitting "send" that I had, in
> fact, missed something and the PHP variables we're not properly set
> for passing to PHPTAL.
>
> False alarm, folks!!
>
> Thanks,
>
> -Alister
>
> 2009/1/2 Alister Cameron <alister.came...@cameroncreative.com
> <mailto:alister.came...@cameroncreative.com>>
>
>     In PHP it's just values in an array (or nested arrays). Created as:
>
>     $tpl[] = array(
>         "nesting" => $nesting
>     );
>
>     Then:
>
>     $template->set('vanilla', $tpl);
>
>     and so forth.
>
>     Does that help?
>
>     -A
>
>     2009/1/2 Maciej Łebkowski <m.lebkow...@gmail.com
>     <mailto:m.lebkow...@gmail.com>>
>
>         On Fri, Jan 2, 2009 at 08:47, Alister Cameron
>         <alister.came...@cameroncreative.com
>         <mailto:alister.came...@cameroncreative.com>> wrote:
>         > Now, can someone explain to me why the first line outputs
>         the value of
>         > vanilla/nesting correctly, but the next line throws a PHPTAL
>         error, saying
>         > 'Unable to find path nst in current scope'.
>
>         Because the error message is not about vanilla/nesting, but
>         about nst var.
>         So - the condition tag is evaluated first.
>
>         > Also, the very fact that I have tried to define a special
>         variable (nst) is
>         > that I can't get the PHP condition to recognise the value of
>         > vanilla/nesting.
>
>         There is no such thing as vanilla/nesting in php. There could
>         be vanilla->nesting or vanilla->nesting() or vanilla[nesting].
>         Which one of those is vanilla/nesting?
>
>
>         --
>         Maciej Łebkowski, http://lebkowski.info/kontakt.php
>
>         _______________________________________________
>         PHPTAL mailing list
>         PHPTAL@lists.motion-twin.com <mailto:PHPTAL@lists.motion-twin.com>
>         http://lists.motion-twin.com/mailman/listinfo/phptal
>
>
>
>
>     -- 
>     Alister Cameron
>     Managing Director
>     Cameron Creative Pty Ltd
>     www.cameroncreative.com <http://www.cameroncreative.com>
>
>     Creative, Strategic, Innovative... never boring!
>
>
>
>
> -- 
> Alister Cameron
> Managing Director
> Cameron Creative Pty Ltd
> www.cameroncreative.com <http://www.cameroncreative.com>
>
> Creative, Strategic, Innovative... never boring!
> ------------------------------------------------------------------------
>
> _______________________________________________
> PHPTAL mailing list
> PHPTAL@lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>   

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to