I am new to this PHP and .tpl thing, And I found a template on this website. When openup the XAMPP Apache server, when I go to localhost/terminal, I get this error :
Fatal error: Uncaught Error: Class “Smarty” not found in C:xampphtdocsterminalindex.php:5 Stack trace: #0 {main} thrown in C:xampphtdocsterminalindex.php on line 5
Thanks in advance.
I have tried reinstall XAMPP, even downloaded Smarty in my project folder via composer, But still this error pops up. A homepage was expected.
This is my folder structure :
enter image description here
Code in index.php :
<?php
require_once 'vendor/autoload.php'; // Include Composer's autoload file
// Initialize Smarty
$smarty = new Smarty();
// Example usage
$smarty->setTemplateDir('templates/');
$smarty->assign('name', 'World');
$smarty->display('index.tpl'); // Make sure 'index.tpl' exists in 'templates/'
// Optional: Output a simple message
echo "Smarty is set up and running!";
?>
Apology for anything mistakes because this is my first time asking a question.