How to load a string or array of library classes in global.php variables?

edited January 2012 in Share
Hi! is there any sample code on how to load a libraries in global variables in global.php and specifying it to a page.?

Thanks. I'm a newbie in FUELcms and I'd like to master this one. It seems the user guide is incomplete enough to new begginers like me :D

Comments

  • edited 4:48PM
    You could use $CI->load->library('my_lib'); assuming $CI is set using get_instance() already:
    $CI =& get_instance(); $CI->load->library('my_lib');
    Alternatively, you could add it to the fuel/application/config/autoload.php config file if you want it to be truly loaded globally.
  • edited 4:48PM
    Thanks! :) what about If want to load it only in a specific page? like for example only in my home page? is it possible?
  • edited 4:48PM
    If it is the homepage, you can create a "home" _variables file and use the specific 'libraries', 'models' or 'helpers' variables. That's explained a little more at the bottom of this page:
    http://www.getfuelcms.com/user_guide/general/opt-in-controllers
  • edited 4:48PM
    i see..now i understand that section! haha, sorry im just a newbie with CI but i know what the framework does. I'm developing a scheduling/reservation web app and I want to allow my client to manage its content, and i think FuelCMS has this capability.

    Thanks for the immediate response! :)
Sign In or Register to comment.