CodeIgniter Forums
need to understand - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: need to understand (/showthread.php?tid=42503)



need to understand - El Forum - 06-09-2011

[eluser]dang2man[/eluser]
hi guys
i am new in ci and i need to understand this portion
why and when i should use this method



function __construct(){
parent::__construct();
}


need to understand - El Forum - 06-09-2011

[eluser]WanWizard[/eluser]
http://php.net/manual/en/language.oop5.decon.php


need to understand - El Forum - 06-09-2011

[eluser]dang2man[/eluser]
i know how to use this method without ci

i want to know when i use __construct in ci

do i use this method when i load library or helper ?


need to understand - El Forum - 06-09-2011

[eluser]WanWizard[/eluser]
When you do use a constructor? When you want to have something done when the class instance is constructed. When do you need to call the parent constructor? When your class extends another class that has a constructor.

There's nothing CI about it, it's a standard class constructor.


need to understand - El Forum - 06-09-2011

[eluser]dang2man[/eluser]
thanks wan for your help