Welcome Guest, Not a member yet? Register   Sign In
Need a little help with a config file for my custom library...???
#6

[eluser]angelleye[/eluser]
Ugh, I'm sorry. For some reason I'm just not following. Here's what I've got.

/system/application/config/PayPal_AP.php contains the following...

Code:
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$config['Sandbox'] = true;
$config['APIUsername'] = 'value';
$config['APIPassword'] = 'value';
$config['APISignature'] = 'value';

/system/application/libraries/PayPal_AP.php contains my library, of course. My original class already received a single parameter (an array of options) but I simply didn't have a default value for it. I went ahead and added that, and then I move on setting options based on whether or not they were passed in via the config array or not...

Code:
function PayPal_AP($DataArray = array())
    {
        
        if(isset($DataArray['Sandbox']))
            $this -> Sandbox = $DataArray['Sandbox'];
.
.
.
}

Then when I try and run with that like you said I'm not getting an error, but the value I'm writing to the page for testing just doesn't write...like it's not finding it correctly.

So I assume that's because I'm doing something incorrectly in my library but that's what I'm missing. You seem to simply be using foreach($params as $param) but then do I use something like $param['option_name'] inside that or what? And then I guess the way my class uses $DataArray already I just need to load $DataArray using values from $param..??

Sorry, I know this is all basics. Just trying to get the hang of CI. Thanks!


Messages In This Thread
Need a little help with a config file for my custom library...??? - by El Forum - 12-19-2010, 03:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB