public function __construct($config) { $this->config = $config; if (method_exists($config, 'getTemplatesDir')) { $this->templates_dir = $this->config->getTemplatesDir(); } else { $this->templates_dir = 'templates/'; } }