public function __construct() {
parent::__construct();
$this->load->config("master");
$this->oops();
$this->database();
$this->load->config("lang");
$this->load->model("functions");
}
what is wrong with the code? i have no idea whats wrong! Can anyone help me pls?
Sorry for my english, i come from germany!
parent::
is for accessing the parent classes implementation of a method. Your class doesn't have a parent, because it does not extend
any class. Hence the error.
class Foo {
public function bar() {
echo 'bar';
}
}
class Baz extends Foo {
public function bar() {
parent::bar();
echo 'baz';
}
}
Here parent
makes sense, because there is a parent class.
class Foo {
public function bar() {
parent::bar();
}
}
Here parent
makes no sense, because there is no parent, hence error. Since it doesn't make sense and serves no purpose, just remove it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With