Closed marcus-at-localhost closed 7 years ago
$this->f3
vs. $f3
maybe, all tests passed and I just do this:
<?php
use Pug\Pug;
include __DIR__ . '/vendor/autoload.php';
$pug = new Pug(array(
'prettyprint' => true,
'extension' => '.pug',
'basedir' => __DIR__ . '/template',
'cache' => false,
'notFound' => false,
));
$data = array();
$output = $pug->render(
__DIR__ . '/template'.'/index.pug',
$data
);
echo $output;
I get expected HTML:
<html5>
<head>
<title>test</title>
</head>
<body>Content</body>
</html5>
PS: html5 does not exists, you need doctype html
then html
here.
I did this with Pug 2.5.5, so I'm pretty sure, this is not the downgrad that solve your problem. Did you check what's out of $f3->get('TEMPLATE')
?
The use of $this->f3
and $f3
was unclear in my example, but not the problem.
I just updated to the latest version again and it worked.
I checked my paths before and I'm sure it was correct, but that must have been the culprit.
Probably a leading slash that I already changed.
Thanks for your time looking into this.
Hi, I installed the latest package (2.5.5) with composer onto my Windows/Xampp Test environment.
first I wasn't able to use this template (index.pug)
I always got that content.pug doesn't exist. Then I read that I have to call render with a file
This didn't work either. index.pug didn't exist.
Finally I downgraded to 2.4 (because I had an app running with that version) and it finally worked.
Any idea?