On Fri, Apr 15, 2011 at 3:37 PM, Brian Sweeney <eclecticg...@gmail.com> wrote: > On Fri, Apr 15, 2011 at 2:47 PM, cricket <zijn.digi...@gmail.com> wrote: >> >> What the heck is this?! >> echo "<?php $product_id = $product_id; ?>"; ?> > > Oh, and I just wanted to say that I was pretty sure this little snippet > would get that kind of reaction. Nice to know that you care enough to point > out the insanity of it all ;)
Shouldn't it at least have the first one escaped? echo "<?php \$product_id = $product_id; ?>"; Not that I'm encouraging this sort of thing. ;-) For the example given, a general product list, another solution would be to go with full on view caching and use javascript to read the cart's product ids and change a class on each product's element block. Given that a flag like this is rather non-critical I don't see any harm in having (potentially disabled) JS handle it. If the list of products were solely the contents of the cart, OTOH, the best answer would be no caching at all. I can't suggest more than that, though, without a clearer understanding of your specific views. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php