Welcome Guest, Not a member yet? Register   Sign In
Pass variables from config to library
#1

[eluser]codex[/eluser]
I'm trying to pass vars from a config file to a library, but I can't get it to work. What I have so far (The config file is autoloaded):

In config
Code:
$config['path_imagemagick']    = '/usr/bin/convert ';
$config['path_tempdir']        = '/home/name/public_html/temp/';
$config['path_photosdir']    = '/home/name/public_html/photos/';

The library
Code:
class CI_ImgResizer_IM {
    
    var $CI;
    var $imagick         = $this->config->item('path_imagemagick');
    var $temppath         = $this->config->item('path_tempdir');
    var $newpath         = $this->config->item('path_photosdir');
    
    /**
     * Constructor
     *
     */    
    function CI_ImgResizer_IM()
    {    
        $this->CI =& get_instance();
        log_message('debug', "ImgResizer_IM Class Initialized");
    }
    
// the functions here

}

What am I missing or doing wrong??


Messages In This Thread
Pass variables from config to library - by El Forum - 10-26-2007, 09:06 AM
Pass variables from config to library - by El Forum - 10-26-2007, 09:28 AM
Pass variables from config to library - by El Forum - 10-26-2007, 09:33 AM
Pass variables from config to library - by El Forum - 10-26-2007, 09:45 AM
Pass variables from config to library - by El Forum - 10-26-2007, 09:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB