• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If else in view

#1
I have added a new field in my controller

$output['ticket:types'][$key]['plus'] = "Yes"

or

$output['ticket:types'][$key]['plus'] = "No"


there is also an existing $output['ticket:types'][$key]['download


In the view there is


{if ticket:types}

                    {ticket:types}']

                   {dropdown}

                    {/ticket:types}
                  {else}
                        
                        <label>No ticket types available.</label><br />
                {/if}        
  {/if}




How do I test the value of $output['ticket:types'][$key]['plus']  in the view? I doesn't recognise {if plus == "Yes}


Thanks
Reply

#2
@Knutsford,

Why don't you test the values before you send them to the view. Do a var_dump or use xdebug to see what is in the variable.
Reply

#3
I want to test if it is Yes and then if it is then add a button
Reply

#4
if (output['ticket:types'][$key]['plus'] == "Yes")
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.