Welcome Guest, Not a member yet? Register   Sign In
Multiple method calls from library
#7

(11-06-2016, 06:44 PM)ramadhansutejo Wrote: you mean like this?
[Image: library_loop_juipk0.png]
try to re-write tour library to :
PHP Code:
class Test
{
    
    protected 
$ci;
    protected 
$value;

    public function 
__construct()
    {
 
       $this->ci =& get_instance();
    }

    public function 
set($value)
 
   {
 
       $this->value $value;
 
   }
 
       
    public 
function get()
 
   {
 
       return $this->value;
 
   }



Thanks for reply,

I made a mistake and tried to extend CI_Controller in my library. Also I forgot that if I need to use CodeIgniter resources I can't extend it but I have to assign CodeIgniter object to variable by reference like you do.

Regards,
ManOfHonor
Reply


Messages In This Thread
RE: Multiple method calls from library - by ManOfHonor - 11-08-2016, 05:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB