error with standalone latte
- IJJN
- Member | 1
Hi
İ've installed latte via composer:
composer require latte/latte
but i have this error
Fatal error: Uncaught RuntimeException: Missing template file ‘Hello.latte’.
in
/storage/emulated/legacy/Aboureyhan/vendor/latte/latte/src/Latte/Loaders/FileLoader.php:42
Stack trace: #0
/storage/emulated/legacy/Aboureyhan/vendor/latte/latte/src/Latte/Engine.php(126):
Latte\Loaders\FileLoader->getContent(‘Hello.latte’) #1
/storage/emulated/legacy/Aboureyhan/vendor/latte/latte/src/Latte/Engine.php(206):
Latte\Engine->compile(‘Hello.latte’) #2
/storage/emulated/legacy/Aboureyhan/vendor/latte/latte/src/Latte/Engine.php(109):
Latte\Engine->loadTemplate(‘Hello.latte’) #3
/storage/emulated/legacy/Aboureyhan/vendor/latte/latte/src/Latte/Engine.php(86):
Latte\Engine->createTemplate(‘Hello.latte’, Array) #4
/storage/emulated/legacy/Aboureyhan/index.php(12):
Latte\Engine->render(‘Hello.latte’, Array) #5 {main} thrown in
/storage/emulated/legacy/Aboureyhan/vendor/latte/latte/src/Latte/Loaders/FileLoader.php
on line 42
İt is my index.php
<?php
require_once('vendor/autoload.php');
$latte = new Latte\Engine;
$latte->setTempDirectory('template');
$params = [
'items' => ['one', 'two', 'three'],
];
// render to output
$latte->render('Hello.latte', $params);
// or render to string
$html = $latte->renderToString('Hello.latte', $params);
?>
- leninzprahy
- Member | 150
Hi,
you are missing the “Hello.latte” file, as the error message says.
On Linux, the case must be correct, Hello.latte != hello.latte