Template Engine with Subdirectory

- Use explicit root path for template engine
- Replace "__DIR__" calls in addons with subdirectories
- Fixes local tests, where call is made out of '/' and not '/vagrant/'
This commit is contained in:
Philipp 2020-04-26 15:45:25 +02:00
parent 62e6c2f781
commit f5f62d3f42
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
4 changed files with 17 additions and 8 deletions

View file

@ -99,19 +99,18 @@ class Renderer
* Load a given template $s
*
* @param string $s Template to load.
* @param string $root Optional.
* @param string $subDir Subdirectory (Optional)
*
* @return string template.
* @throws Exception
*/
public static function getMarkupTemplate($s, $root = '')
public static function getMarkupTemplate($s, $subDir = '')
{
$stamp1 = microtime(true);
$a = DI::app();
$t = self::getTemplateEngine();
try {
$template = $t->getTemplateFile($s, $root);
$template = $t->getTemplateFile($s, $subDir);
} catch (Exception $e) {
echo "<pre><b>" . __FUNCTION__ . "</b>: " . $e->getMessage() . "</pre>";
exit();