• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
variable in function of view

#1
[eluser]shkim[/eluser]
I want to use a variable $abcde in a function of a view like the following code:

---------------------------------------
controller:
$data['abcde'] = 1;
$this->load->view('myview', $data);


myview:
function xxx()
{
$yyy = $abcde; <-- undefined variable error
}

$zzz = $abcde; <-- ok

---------------------------------------

What's wrong with me?


Messages In This Thread
variable in function of view - by El Forum - 07-06-2007, 02:44 PM
variable in function of view - by El Forum - 07-06-2007, 10:59 PM
variable in function of view - by El Forum - 07-06-2007, 11:26 PM
variable in function of view - by El Forum - 07-06-2007, 11:59 PM
variable in function of view - by El Forum - 07-07-2007, 05:28 AM
variable in function of view - by El Forum - 07-07-2007, 06:00 PM
variable in function of view - by El Forum - 07-07-2007, 09:55 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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