If I have a class that extends another class that in turn extends another class, is it possible to change how an if statement evaluates in the parent -> parent class from a specific method in the child class?
Top Level Parent Class
class MY_Controller { if ($add_assets) { /* include assets here */ } }
Middle Level Class
class Account_Controller extends MY_Controller { /* this controller determines permissions, etc. */}
Child Class
class Posts_Controller extends Account_Controller {
public function createPDF() { $add_assets = FALSE; }
}
So in this instance can I use the createPDF() method in the Posts controller to tell the MY_Controller not to include any assets.