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

[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
class Makeapayment {

    var $data;

    function Makeapayment($data = array())
    {    
        $this->data = $data;
    }

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

}


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