![]() |
Easy Question: Handling Arrays in Custom Libraries - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Easy Question: Handling Arrays in Custom Libraries (/showthread.php?tid=23556) |
Easy Question: Handling Arrays in Custom Libraries - El Forum - 10-14-2009 [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'); I am loading the library/calling the class in my controller as follows: Code: $this->load->library('Makeapayment', $data); 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? Easy Question: Handling Arrays in Custom Libraries - El Forum - 10-14-2009 [eluser]moodh[/eluser] Code: $this->load->library('Makeapayment'); Easy Question: Handling Arrays in Custom Libraries - El Forum - 10-14-2009 [eluser]Unknown[/eluser] I knew it had to be something simple - thanks! Easy Question: Handling Arrays in Custom Libraries - El Forum - 10-14-2009 [eluser]pistolPete[/eluser] If you load the library like this, Code: $this->load->library('Makeapayment', $data); the $data array will be passed to the library's constructor. Code: <?php |