• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Accessing $this->load->view from global functions

#1
[eluser]koniciwa[/eluser]
Need help accessing $this->load->view from a global function (which isn't in a class). A sort of wrapper function that saves me from typing $this->something. As expected, $this doesn't work outside a class.
Thanks in advance Smile

#2
[eluser]Phil Sturgeon[/eluser]
Code:
$CI =& get_instance();
$CI->load->view('blerf');

#3
[eluser]koniciwa[/eluser]
Thanks mate! Works like a charm... didn't know it could work outside the 'libraries' context.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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