I’m not sure what’s happening here, perhaps someone has a clue:
On my layout I have this:
<div id="main-content" class="<?= $this->getMainClass(); ?>">
On components>controller class I have this:
private $_mainCssClass;
public function setMainCssClass($className) {
if (is_string($className)) {
$this->_mainCssClass = $className;
} else {
quickDump($className);
}
}
public function getMainCssClass() {
return $this->_mainClass;
}
What I’m not getting is, despite the fact that we are using accessors, and the mainCssClass property has an underscore and it’s declared private, I can access it trough:
$this->MainCssClass;
The same as: $this->getMainCssClass()