Perhaps I'm just missing a basic OOP idea in PHP, but for the life of me, I can't seem to set the "$template" variable dynamically.
If I extend the Template_Controller, I can set the template name like this:
public $template = 'template_file_name';
But I can't set it dynamically like:
public $template = $this->setTemplate();
or
switch($var):
default:
public $template = 'filename';
break;
endswitch;
Changing the $template variable using $this->template in the constructor breaks the Template_Controller somehow:
Fatal error: Call to a member function render() on a non-object
I need to set the template filename based on a variable set in the constructor, or perhaps pulled from an external library.
Any ideas how to make this possible?