Welcome Guest, Not a member yet? Register   Sign In
IF statement with a template
#1

[eluser]webshark[/eluser]
Hi,

My views are parsed using the CodeIgniter built in template parser and I am displaying a list of items via a loop (data pulled from database):

My views code:

Code:
{found_content}
<li>{title} - {description} - {image} - {id}</li>
{/found_content}

My question can I run an IF statement using the parsed vars, something like
{if $id == 1}
do something here
{else}
do something else
{/if}

from within the view? similar to Smarty?
#2

[eluser]webshark[/eluser]
Found my answer after an extensive search in the forums:
http://ellislab.com/forums/viewthread/68878/#341795

Saved me from using Smarty (I hate it!)
#3

[eluser]The Wizard[/eluser]
ive used smarty in all my other projects,
i think ill use it here too Smile

its cool, why hate it?




Theme © iAndrew 2016 - Forum software by © MyBB