class Content extends CodonModule {
public $title = 'Operations';
public function operations() {
$this->show('operations');
}
public $title = 'Staff';
public function staff() {
$this->show('staff');
}
}
I'm trying to give every template a title, but it can't redeclare a class, how can I bypass this? I tried putting public $title inside the function, but that doesn't follow the documentation, and doesn't work, it just throws an undefined T_PUBLIC error.
As said in a comment by Michael Berkowski, set the title inside the functions. This will cause the title to be set as the function is called.
class Content extends CodonModule {
public $title;
public function operations() {
$this->title = 'Operations';
$this->show('operations');
}
public function staff() {
$this->title = 'Staff';
$this->show('staff');
}
}
This file is included/required several times in a row. You can have only 1 class defined with this name, but you can have several objects as instances of this class.