0
class ControllerBase
{

}


class postSmsController extends ControllerBase
{

}

class SmsSentController extends ControllerBase
{

}

CotrollerBase を phalcon の他のコントローラーと一緒に拡張する方法、SmsSentController で postSmsController の関数を使用したい、また両方の Controller クラスで ControllerBase の関数を使用したい。私は何をすべきか

4

1 に答える 1

0

あなたは別のものから拡張することができます

// Base controller
class ControllerBase
{
    public function one()
    {

    }
}


// Extending. Offers one() and two()
class postSmsController extends ControllerBase
{
    public function two()
    {

    }
}

// Extending. Offers one() and two() and three()
class SmsSentController extends postSmsController
{
    public function three()
    {

    }
}

// Offers only one()
class otherController extends ControllerBase
{

}
于 2013-07-11T13:26:30.813 に答える