public function __construct($base, $theme)
{
// Use internal templates or the ones in the phar
// archive if no templates dir exists in the working directory
if (!is_dir($base)) {
if (is_dir(__DIR__ . '/../../../templates')) {
$base = __DIR__ . '/../../../templates';
} else {
$base = 'phar://daux.phar/templates';
}
}
// Create new Plates instance
$this->engine = new Engine($base);
if (!is_dir($theme)) {
$theme = $base;
}
$this->engine->addFolder('theme', $theme, true);
$this->registerFunctions();
}