[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