PHP - extended __construct

后端 未结 3 957
广开言路
广开言路 2021-01-31 08:09

I was wondering if you could help me out..

I have two classes, one extends the other.. Class B will be extended by various different objects and used for common databas

3条回答
  •  臣服心动
    2021-01-31 08:50

    I'm not sure I fully understand what you are asking, but you can call the parents construct method from the child's constructor

    parent::__construct();
    

    That's the only option I know of.

提交回复
热议问题