diff --git a/resources/cache/8d/8d399cc9bad04668d8048ae3036be6c210d2d6db6b6a824ddae4b40902b786e2.php b/resources/cache/8d/8d399cc9bad04668d8048ae3036be6c210d2d6db6b6a824ddae4b40902b786e2.php new file mode 100644 index 0000000..14a3067 --- /dev/null +++ b/resources/cache/8d/8d399cc9bad04668d8048ae3036be6c210d2d6db6b6a824ddae4b40902b786e2.php @@ -0,0 +1,60 @@ +source = $this->getSourceContext(); + + $this->parent = false; + + $this->blocks = [ + ]; + } + + protected function doDisplay(array $context, array $blocks = []) + { + $macros = $this->macros; + // line 1 + echo "Werkt het: "; + echo twig_escape_filter($this->env, ($context["test"] ?? null), "html", null, true); + } + + public function getTemplateName() + { + return "index.html"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 37 => 1,); + } + + public function getSourceContext() + { + return new Source("", "index.html", "C:\\Users\\maart\\PhpstormProjects\\framework\\resources\\views\\index.html"); + } +} diff --git a/src/Runtime/Factory/BootstrapFactory.php b/src/Runtime/Factory/BootstrapFactory.php index cc0d22d..0d11c7e 100644 --- a/src/Runtime/Factory/BootstrapFactory.php +++ b/src/Runtime/Factory/BootstrapFactory.php @@ -44,4 +44,12 @@ class BootstrapFactory { return null; } + /** + * @return string + */ + public function resourcePath() + { + return "../resources/"; + } + } \ No newline at end of file diff --git a/src/Runtime/Helpers/helpers.php b/src/Runtime/Helpers/helpers.php index c056c91..5e55ed2 100644 --- a/src/Runtime/Helpers/helpers.php +++ b/src/Runtime/Helpers/helpers.php @@ -7,12 +7,12 @@ if(!function_exists('app')) { /** * @param null $abstract - * @return mixed|Container + * @return \Runtime\Factory\BootstrapFactory|Container */ function app($abstract = null) { if (is_null($abstract)) { - Bootstrap::getInstance(); + return Bootstrap::getInstance(); } return Bootstrap::getInstance()->make($abstract); diff --git a/src/Runtime/Http/Views/Factory.php b/src/Runtime/Http/Views/Factory.php index 7519c31..7a3621e 100644 --- a/src/Runtime/Http/Views/Factory.php +++ b/src/Runtime/Http/Views/Factory.php @@ -3,22 +3,15 @@ namespace Runtime\Http\Views; -use ClassNotFoundException; use Runtime\Exceptions\ExceptionHandler; use Twig\Environment; use Twig\Error\LoaderError; use Twig\Error\RuntimeError; use Twig\Error\SyntaxError; -use Twig\Loader\ArrayLoader; use Twig\Loader\FilesystemLoader; class Factory implements \Runtime\Contracts\View\Factory { - /** - * @var string - */ - private $resourcesDir = '/../resources/'; - /** * @var string */ @@ -39,9 +32,9 @@ class Factory implements \Runtime\Contracts\View\Factory { */ public function __construct() { - $loader = new FilesystemLoader(getcwd() . $this->resourcesDir . 'views'); + $loader = new FilesystemLoader(app()->resourcePath() . 'views'); $this->twig = new Environment($loader, [ - 'cache' => $this->resourcesDir . 'cache' + 'cache' => app()->resourcePath() . 'cache' ]); }