Welcome Guest, Not a member yet? Register   Sign In
Global Strings!
#4

[eluser]jordanarseno[/eluser]
Thank you! - That was a very informative article.
I left a comment on Phil's blog, but his processing engine destroyed half of my message, and it won't let me post a new one Sad

Therefore, question for you, and you...and you!

I followed Phil's method - I now have a MY_Controller class.

Now, he mentioned at the bottom of his post, I quote:
Quote:You can also use $this->load->vars('foo', $bar) in your Base Controllers to set values that are only available in your views.

So in MY_Controller, I have the following:

Code:
$arr = array (
'test1' => '123',
'test2'  => 'abc'
);

$this->load->vars($arr);

And in my view:

Code:
<?php  echo $arr['test1'];?>

I'm getting the error: Message: Undefined variable: arr

Why!!


Messages In This Thread
Global Strings! - by El Forum - 10-10-2010, 10:41 PM
Global Strings! - by El Forum - 10-10-2010, 11:59 PM
Global Strings! - by El Forum - 10-11-2010, 12:03 AM
Global Strings! - by El Forum - 10-12-2010, 06:12 AM
Global Strings! - by El Forum - 10-12-2010, 06:14 AM
Global Strings! - by El Forum - 10-12-2010, 06:17 AM
Global Strings! - by El Forum - 10-12-2010, 07:05 AM
Global Strings! - by El Forum - 10-12-2010, 07:27 AM
Global Strings! - by El Forum - 10-12-2010, 07:34 AM
Global Strings! - by El Forum - 10-12-2010, 07:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB