Welcome Guest, Not a member yet? Register   Sign In
when to use parent::__construct(); in the class?
#1

[eluser]Unknown[/eluser]
Dear all
I`ve started learning CI by the tutorial in the User Guide.
I found the News_model did not add the parent::__construct()
Code:
News_model extends CI_Model {
public function __construct()
...//
But the News controller starts with parent::__construct()
Code:
class News extends CI_Controller {

public function __construct()
{
  parent::__construct();
Could anyone kindly tell me the differences?
And whats the criteria of adding the parent::__construct() when creating the class?
Many thanks


Messages In This Thread
when to use parent::__construct(); in the class? - by El Forum - 09-20-2013, 12:35 AM
when to use parent::__construct(); in the class? - by El Forum - 09-20-2013, 08:34 AM
when to use parent::__construct(); in the class? - by El Forum - 09-22-2013, 06:57 AM
when to use parent::__construct(); in the class? - by El Forum - 09-22-2013, 07:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB