Welcome Guest, Not a member yet? Register   Sign In
Some functions in Controller
#7

(11-18-2017, 05:54 AM)neuron Wrote: In Documentation :
PHP Code:
class MY_Input extends CI_Input {

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


And as the documentation says "If you need to use a constructor in your class make sure you extend the parent constructor:"

If you don't have work that must happen in a constructor then you don't need to define a constructor only for purpose of calling parent::__construct(). PHP will take care of that automatically.  

However, if you do define __construct() then you must explicitly call parent::__construct()
Reply


Messages In This Thread
Some functions in Controller - by rolly - 11-17-2017, 07:25 AM
RE: Some functions in Controller - by neuron - 11-17-2017, 08:31 AM
RE: Some functions in Controller - by Narf - 11-17-2017, 11:16 AM
RE: Some functions in Controller - by neuron - 11-18-2017, 05:54 AM
RE: Some functions in Controller - by kilishan - 11-17-2017, 09:32 AM
RE: Some functions in Controller - by rolly - 11-17-2017, 11:12 AM
RE: Some functions in Controller - by dave friend - 11-18-2017, 07:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB