* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net) */ class PHPEngine implements TemplateEngine { /** * The currently used directory by the template. * * @var string */ protected $directory; /** * All the currently assigned variables. * * @var array */ protected $assigned_variables = array(); public function setDirectory($directory) { $this->directory = $directory; } public function get($file, $assigned_variables) { // First set all the variables $this->assigned_variables = $assigned_variables; $vars = $this->assigned_variables; $directory = $this->directory; // Then run the file if (!is_null($file)) { ob_start(); include $file; return ob_get_clean(); } } public function getFileExtensions(): array { return array('php'); } public function reset(): bool { $this->directory = null; $this->assigned_variables = array(); return true; } }