大家好,我是一个Php新手,请教一个问题
base.php
class base {protected function __construct($adapter=null) { } static public function init($default_adapter = null)
{
}
}drived.php
class drived extends base {
public function __construct() {
parent::__construct();
}}
之后我有一个test.php
class test {
$drived = new drived();
//在这里我怎么调用父类里的init方法?
}
base.php
class base {protected function __construct($adapter=null) { } static public function init($default_adapter = null)
{
}
}drived.php
class drived extends base {
public function __construct() {
parent::__construct();
}}
之后我有一个test.php
class test {
$drived = new drived();
//在这里我怎么调用父类里的init方法?
}
$drived = new drived();
//在这里我怎么调用父类里的init方法?
}
????
没有继承,哪来的"父类"
$drived = new drived();
$drived->init();
function __construct()
{
parent :: 对应的父类方法名称;
}