[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?