Welcome Guest, Not a member yet? Register   Sign In
Custom libraries with custom config files ... how?
#2

[eluser]tomcode[/eluser]
In Your case the config file needs to be named someclass.php.


Inside You have the standard config notation

Code:
$config['var_key'] = '"Variable Value"';


And in the library

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Someclass {

    var $var_key = 'to be overriden';

    function Someclass($params = false)
    {
        // Do something with $params

       $this->init($params);
    }

    function init($params = false)
    {
        foreach($params as $key => $value)
        {
              $this->$key = $value;
        }
    }
}


Messages In This Thread
Custom libraries with custom config files ... how? - by El Forum - 05-23-2009, 09:04 PM
Custom libraries with custom config files ... how? - by El Forum - 05-24-2009, 12:36 AM
Custom libraries with custom config files ... how? - by El Forum - 05-27-2009, 02:31 PM
Custom libraries with custom config files ... how? - by El Forum - 05-27-2009, 03:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB