Welcome Guest, Not a member yet? Register   Sign In
Does a model require that you extend the base model class?
#11

[eluser]xwero[/eluser]
You probably do this
Code:
class test extends Controller
{
    function index()
    {
        echo 'test';
    }
    
    function test2()
    {
        echo $this->uri->segment(2); // you will get an error
    }
}
As you can see in controllers page of the user guide the extended constructor overwrites the parent constructor. Constructors are optional as long as you don't add a constructor in your extended classes.

But by adding a constructor you are protecting yourself for errors not adding the parent constructor if you do need a constructor in the extended class
#12

[eluser]dtrenz[/eluser]
[quote author="dtrenz" date="1205518902"]I thought that it was only required if I wanted to add my own code to the constructor.[/quote]

so this statement is correct then?
#13

[eluser]xwero[/eluser]
[quote author="dtrenz" date="1205522914"][quote author="dtrenz" date="1205518902"]I thought that it was only required if I wanted to add my own code to the constructor.[/quote]

so this statement is correct then?[/quote]
yes




Theme © iAndrew 2016 - Forum software by © MyBB