Hay Leute,
ich versuche mich gerade in die dwoo Template engine einzuarbeiten und versuche mich gerade an der Template Inheritance. Allerdings bekomme ich eine Error-Meldung wenn ich versuche das erweiternde Template zu laden.
Hier einmal die Fehler Meldung:
Leider sehr unübersichtlich...
PHP Code:
error] [client ::1] PHP Fatal error:
Uncaught exception 'Dwoo\\Exception\\CompilationException' with message 'Compilation error at line 1 in
"file:/Library/Server/Web/Data/Sites/Default/Test/dwoo/login.tpl" :
Extends : Resource "file:../index/index.tpl" not found.' in /Users/lucafuhl/Sites/dwoo/lib/Dwoo/Plugins/Functions/FunctionExtends.php:86\nStack trace:\n#0 [internal function]:
Dwoo\\Plugins\\Functions\\FunctionExtends::compile(Object(Dwoo\\Compiler), '"../index/index...')\n#1 /Users/lucafuhl/Sites/dwoo/lib/Dwoo/Compiler.php(2058):
ReflectionMethod->invokeArgs(NULL, Array)\n#2 /Users/lucafuhl/Sites/dwoo/lib/Dwoo/Compiler.php(1427):
Dwoo\\Compiler->parseFunction('{extends "../in...', 1, 74, false, 'root', 29)\n#3 /Users/lucafuhl/Sites/dwoo/lib/Dwoo/Compiler.php(795):
Dwoo\\Compiler->parse('{extends "../in...', 1, NULL, false, 'root', 29)\n#4 /Users/lucafuhl/Sites/dwoo/lib/Dwoo/Template/String.php(373):
Dwoo\\Compiler->compile(Object(Dwoo\\Core), Object(Dwoo\\Template\\Fil in /Users/lucafuhl/Sites/dwoo/lib/Dwoo/Plugins/Functions/FunctionExtends.php on line 86
und hier noch die beiden Templates:
index.tpl
HTML Code:
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{$title} | BFiled Ticketsystem</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<h1>Hello, world!</h1>
<p>{$a}{$b}</p>
{block "test"}
<p>Default message</p>
{/block}
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
login.tpl
HTML Code:
{extends "index.tpl"}
{block "test"}
<p> Loogin.tpl</p>
{/block}
index.php
PHP Code:
<?php
// Include the main class and register autoloader class (it should handle the rest on its own)
require 'lib/Dwoo/Autoloader.php';
require_once 'inc/config.php';
\Dwoo\Autoloader::register();
// Create a Dwoo core object
$dwoo = new \Dwoo\Core();
// Create some data
$data = array('a'=> ROOT_PATH, 'b'=> " Schneeman!!", "title" => "Login");
// Output the result ...
$dwoo->output(ROOT_PATH . 'login.tpl', $data);
// ... or get it to use it somewhere else
//echo $dwoo->get('./index.tpl', $data);
Leider hab ich bisher nicht viel zu dem Fehler gefunden, wäre nice wenn hier jemand wüsste woran das liegen könnte...