Welcome Guest, Not a member yet? Register   Sign In
How do I subclass one of my own controllers? [SOLVED]
#2

[eluser]Jelmer[/eluser]
Maybe just like this? (not pretty but probably works)

Code:
<?php

require APPPATH . 'controllers/done.php';

class Todo extends Done
{

    public function __construct()
    {
        parent::__construct();
        echo "Todo constructor<br/>";
    }

    public function index()
    {
        echo "Inside Todo index <br/>";
    }

}

I haven't done this, but I have worked with multiple base controllers. I implemented those by writing an autoloader that would autoload the class after "extends". Thus avoiding needing "require" and it might also be a better solution for you. Write one abstract base controller and then extend both Todo and Done from that base.


Messages In This Thread
How do I subclass one of my own controllers? [SOLVED] - by El Forum - 07-22-2010, 03:46 PM
How do I subclass one of my own controllers? [SOLVED] - by El Forum - 07-22-2010, 04:06 PM
How do I subclass one of my own controllers? [SOLVED] - by El Forum - 07-22-2010, 06:23 PM
How do I subclass one of my own controllers? [SOLVED] - by El Forum - 01-28-2012, 01:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB