1
Я пытаюсь разработать аддон для моего WHMCS с использованием API WHMCS и smarty.Как использовать smarty в WHMCS addon
Я создал модуль и теперь при загрузке создаю новый экземпляр $ smarty, а затем попытаюсь загрузить файл шаблона, который находится в каталоге addon_name/template
, но я не могу.
Ниже мой код и мои ошибки:
WHMCS Выход:
function statement_generator_output($vars) {
include('mainform.php');
}
Mainform.php:
<?
require_once '/home/account/public_html/hosting/vendor/smarty/smarty/libs/Smarty.class.php';
$smarty = new Smarty;
//$smarty->force_compile = true;
$smarty->debugging = true;
$smarty->caching = false;
$smarty->cache_lifetime = 120;
$smarty->assign("action", 'hello');
$smarty->display('/home/account/hosting/modules/addons/statement_generator/template/statement_generator.tpl');
?>
Ошибка:
Fatal error: Uncaught --> Smarty: Unable to load template file '/home/account/hosting/modules/addons/statement_generator/template/statement_generator.tpl' <-- thrown in /home/account/public_html/hosting/includes/classes/WHMCS/Terminus.php on line 0