• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved]$this->load->vars($array) question


The variables loaded using $this->load->vars($array) are usable inside the controller ?
If so, how ?

I tried like this but no luck inside the view is ok but not in the controller
I'm using the latest reactor from bitbucket
class Welcome extends MY_Controller {
    function __construct()
        $myvars['b'] = 'test';

    function index()
        echo $b;

No, the result of $this->load->vars() is only used in views.

The example is a bit pointless, if you want something like that, either use $this->b, or $this->myvars['b'] if you want to retain the array.

thanks for responding
i always used $this->b but i wanted to be sure on the purpose of $this->load->vars()

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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