composer.json:Smarty_Internal_TemplateCompilerBase沒有找到
{
"require": {
"smarty/smarty": "v3.1.17"
}
}
的index.php:
define('SMARTY_SPL_AUTOLOAD', 1); // now smarty should use its own autoloader
require_once __DIR__ . "/vendor/autoload.php";
function my_classes_loader($class) {
$path = "{$class}.class.php";
if (file_exists($path)) {
include_once $path;
return true;
}
return false;
}
spl_autoload_register('my_classes_loader');
$smarty = new Smarty();
$smarty->setCompileDir("templates_c");
$smarty->display('main.html');
exit();
如果我在瀏覽器中打開它,我得到
Fatal error: Class 'Smarty_Internal_TemplateCompilerBase' not found in //smarty-example/vendor/smarty/smarty/distribution/libs/sysplugins/smarty_internal_smartytemplatecompiler.php on line XX
的文件是存在的。它有內容。並且它對於PHP等是可訪問/可讀的。
我在做什麼錯?什麼不見了?