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 12:57AM
    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 12:57AM
    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 12:57AM
    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 12:57AM
    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.