[support] trying to create zebra striping in custom block

Pierre Rineau pierre.rineau at makina-corpus.com
Wed Jun 16 14:54:49 UTC 2010


Le mercredi 16 juin 2010 à 17:46 +0300, Fred Jones a écrit :
> > Or the condensed version:
> >
> > print "<tr class=\"" . (($oddeven++ % 2) ? "odd" : "even") . "\"><td>";
> 
> I am humbled.
> 
> > I like obfuscation, this is the story of my life.
> 
> Code obfuscation? +1 for job security. :)
> 
> LOL

Ahah :)

I could have wrote:

list($would,
  $beer,
   $I,
  $love,
$some) = array(
  (bool) (((((int)$oddeven)++) % 2) == 0), "\"><td>"
    "<tr class=\"", "odd", "even"
);

// WTF!
print $I . ($would ? $love : $some) . $beer;

// Tell me if that works please :)

Pierre.



More information about the support mailing list