Welcome Guest, Not a member yet? Register   Sign In
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




Theme © iAndrew 2016 - Forum software by © MyBB