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

  • edited February 2012
    This is the dwoo that gets generated when i import my view file
    {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}
  • edited 5:31AM
    A couple things to test:
    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?
  • if i change the dwoo to {if $catId == "test"} it works. Is there a bug in the importing of a view file with an if statement or am i doing something goofy?
  • edited 5:31AM
    I'll take a look at the importing with if conditionals. The importing isn't perfect but meant to get a majority of the php code scenarios found when importing view files.
Sign In or Register to comment.