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

[eluser]Michael Wales[/eluser]
I thought about that... if that is the case, well you obviously can't just use $this->config (unless you feel like writing a config class...

I'm not the most gangster OOP programmer, but what if you tried this:

Code:
var $CI;
    var $imagick;
    var $temppath;
    var $newpath;

    function __construct() {
        $this->CI =& get_instance();
        $this->imagick         = $this->CI->config->item('path_imagemagick');
        $this->temppath         = $this->CI->config->item('path_tempdir');
        $this->newpath         = $this->CI->config->item('path_photosdir');
    }

You will then just have to remember to refer to them as class variables.


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