Problem with endif - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Problem with endif (/showthread.php?tid=18842) |
Problem with endif - El Forum - 05-20-2009 [eluser]tobbesanda[/eluser] Hello there! I'm new with CI but kind of familiar with PHP and I must say, This CI is really great! Damn I've saved time. But now to my problem. I can't use endif or endforeach. I get parse error for some reason. It works ok if I open with { and close with } I can't figure this out, anyone have an idea? Greetings from Sweden! /Tobias Problem with endif - El Forum - 05-20-2009 [eluser]Dam1an[/eluser] Hi, welcome to CI Can you post you're code please (using [ code ] tags) Problem with endif - El Forum - 05-20-2009 [eluser]tobbesanda[/eluser] It's a simple code like: Code: <?php if (isset($navigation) && !empty($navigation)); ?> It works if I use: Code: <?php if (isset($navigation) && !empty($navigation)) { ?> I find it really strange... Problem with endif - El Forum - 05-20-2009 [eluser]Dam1an[/eluser] It should be Code: <?php if (isset($navigation) && !empty($navigation)): ?> Colons for the opening statements, and a standard semi colon when you close the if/foreach Problem with endif - El Forum - 05-20-2009 [eluser]tobbesanda[/eluser] hehe thx a lot! You go blind in front of all codes after a few hours =) Perhaps time for a break! Thanks again for the quick reply. /Tobias Problem with endif - El Forum - 05-20-2009 [eluser]Dam1an[/eluser] Your welcome Yeah, its so easy to miss these things, but thats the first thing I went to look for, cause I initially made the same mistake when I first used the alternative syntax Problem with endif - El Forum - 05-20-2009 [eluser]Thorpe Obazee[/eluser] You probably need a better editor to 'see' these errors. Problem with endif - El Forum - 05-21-2009 [eluser]Dam1an[/eluser] [quote author="bargainph" date="1242885929"]You probably need a better editor to 'see' these errors.[/quote] If you're using a better editor (or IDE, such as Eclipse PDT in my case) it will autocomplete it for you so you don't get a chance to do it wrong |