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

I have added a new field in my controller

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


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

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

In the view there is

{if ticket:types}



                        <label>No ticket types available.</label><br />

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



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.

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

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 )

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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