CodeIgniter Forums
a quesion - 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: a quesion (/showthread.php?tid=5199)



a quesion - El Forum - 01-10-2008

[eluser]flash866[/eluser]
Code:
$this->session->set_userdata($sessdata);

in this code , why have two '->' ? what's mean?

can you take a example?


a quesion - El Forum - 01-10-2008

[eluser]flash866[/eluser]
Code:
<?php
class c1{
    var $test;
    function __construct(){
        $this->test=new efg();
    }
}
class efg{
    function w(){
        echo 'love you!';
    }
}

$a=new c1;
$a->c1->w();
?>
But this code is error:
Fatal error: Call to a member function w() on a non-object in C:\Documents and S
ettings\Ltd\My Documents\Noname1.php on line 15
请按任意键继续. . .


a quesion - El Forum - 01-10-2008

[eluser]flash866[/eluser]
Code:
$a=new c1;
$a->test->w();
the error is find,ha ha.