if statement in view is causing dwoo error
I got a strange problem. I have a dwoo error being caused by the if statement in this snippet
<?php foreach($categories as $category) : ?>
<?php if($category): ?>
<li class="currentPage"><a href="<?php echo $category->title; ?>"><?php echo $category->title; ?></a></li>
<?php endif; ?>
<?php endforeach; ?>
The error message is Parse error: syntax error, unexpected ')' in /Users/tomcaflisch/Sites/CampbellCustomCoatings-new/trunk/campbellcustomcoatings/fuel/application/cache/dwoo/compiled/5595746fa8a972207462dacea8715e3c.d17.php on line 226
If i remove the "if" and "endif" lines, it works fine. Am i doing something incorrect to cause this error?
Comments
http://getfuelcms.com/user_guide/parsing/parsing_examples
{foreach $categories category } {$catId = $category->id} {if($catId == 'test') } <li class="currentPage"><a href="{site_url("patterns/$catId")}">{$category->title}</a></li> <li><a href="{site_url("patterns/$catId")}">{$category->title}</a></li> {/if} {/foreach}
1. What if you change the conditional to something like this {if $catId == "test"}?
2. Is the $catId in the site_url function possibly causing the problem?