Edu,

The problem is probably that PHPTAL parser doesn't know how to correctly
process the PHP ternary operator. I suggest you try using a function to
accomplish the same:

function ternary($condition, $true, $false) {
  return $condition ? $true : $false;
}

<table tal:attributes="class php: ternary(record/works_page,
'llista_cancons', 'llista_canconsindiv')">

By the way, the Paamayim Nekudotayim error is as common as missleading in
PHP, most lexing ambiguities are resolved by the parser with this error :(

ciao,
/imv

On Sun, Oct 12, 2008 at 11:24 AM, Eduard Gamonal <[EMAIL PROTECTED]>wrote:

> > I don't know what your Hebrew message says,
> http://en.wikipedia.org/wiki/Paamayim_Nekudotayim
> it's "double colon" in Hebrew.
>
> > but if I were you, I'd use
> > 'style1' instead of 'style1''.
> sorry, that was a typo. I changed the desired class names for dummy
> ones. Here's the line I'm using:
>
>    <table tal:attributes="class php: record/works_page ?
> 'llista_cancons' : 'llista_canconsindiv'  ">
>
>
> Edu
>
> Eduard Gamonal
>
>
> >
> > Roman
> >
> > On Sat, Oct 11, 2008 at 6:30 PM, Eduard Gamonal <[EMAIL PROTECTED]>
> wrote:
> >>
> >> Hi,
> >> I'm developing a website using ccHost, and got trapped in a line:
> >>    <table tal:attributes="class php: record/works_page ? 'style1'' :
> >> 'style2'  " >
> >>
> >>  record/works_page contains a boolean value, and according to that, i
> >> may apply style1 or style2.
> >> I tried it changing the slashes into dots, but didn't work. I get the
> >> famous Hebrew error:
> >>
> >> Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in
> >>
> >> /home/server/
> musicalliure.net/subdominis/proves/httpdocs/mll_files/temp/tpl_0_7_0_060569839c3080481dfb9a552861235b.php
> >> on line 516
> >>
> >> a line like <div tal:condition="not: record/works_page"
> >> class="llista_cancons_titol"> has worked properly in the same context.
> >> what's wrong in the first line, then?
> >>
> >> Thanks :)
> >>
> >>
> >>
> >> Edu
> >>
> >> Eduard Gamonal
> >>
> >> _______________________________________________
> >> 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
> >
> >
>
> _______________________________________________
> 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