public function __call($name, $args) { switch (strtolower($name)) { case 'document': case 'output': case 'template': return $this->{$name}; default: return parent::__call($name, $args); } }