Welcome Guest, Not a member yet? Register   Sign In
Easy Question: Handling Arrays in Custom Libraries
#1

[eluser]Unknown[/eluser]
Trying to learn CodeIgniter & PHP better at the same time.

I'm building a custom library to handle payments for a registration system I'm building in CI.

Here's my basic code in my library:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Makeapayment {

    function charge($data)
    {    
        $first_name = $this->data['first_name'];
    }

}

?>

I am loading the library/calling the class in my controller as follows:

Code:
$this->load->library('Makeapayment', $data);
$this->makeapayment->charge();

It's not working correctly. I'm sure this is an easy answer for someone. How do I accessing variables in my library from the passed array?


Messages In This Thread
Easy Question: Handling Arrays in Custom Libraries - by El Forum - 10-14-2009, 09:36 AM
Easy Question: Handling Arrays in Custom Libraries - by El Forum - 10-14-2009, 10:19 AM
Easy Question: Handling Arrays in Custom Libraries - by El Forum - 10-14-2009, 10:32 AM
Easy Question: Handling Arrays in Custom Libraries - by El Forum - 10-14-2009, 10:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB