I know how to call a protected function in a child class. Are there any other methods to call a protected function in a child class besides demonstrated below?
My Parent Calss {
class myadmin {
function __construct() {
}
protected function _layouts(){
return "Hello world";
}
}
Child Class
class adminpanel extend myadmin {
public function index() {
$this->_layouts();
// or
parent::_layouts();
}
}
$this->_layouts()
parent
or$this
, Both would do,