これは非常にばかげた質問でなければなりませんが、私は答えを探していて問題を見つけることができません...スマートなテンプレートを表示しようとする際にいくつか問題があります、私はSmartyの古いバージョンを使用していたし、すべてがうまく働いていた、しかし、私はSmartyの3に更新され、私は、それがメッセージ例外を言ってしまった:未知の方法「表示」のSmarty:不明なメソッド 'display'の呼び出し
コール。
これは私のコードです:
のindex.php
require_once './GeneralFunctions.php';
$smartyVariables = getSmartyVariablesToAssign();
tryToDisplaySmartyTemplate('Index.tpl', $smartyVariables);
function getSmartyVariablesToAssign() {
$userAndOrPasswordError = $_GET['userAndOrPasswordError'];
return array(
'userAndOrPasswordError' => $userAndOrPasswordError
);
}
GeneralFunctions.php
require_once './smarty/libs/Smarty.class.php';
function tryToDisplaySmartyTemplate($templateName, $variablesToAssign = null) {
try {
$mySmarty = callSmarty();
assignSmartyVariables($mySmarty, $variablesToAssign);
$mySmarty->display($templateName);
} catch (Exception $exc) {
showCatchedExceptionTraceAndMessage($exc);
}
}
function callSmarty() {
$mySmarty = new Smarty();
$mySmarty->template_dir = 'smarty/templates';
$mySmarty->compile_dir = 'smarty/templates_c';
$mySmarty->config_dir = 'smarty/config';
$mySmarty->cache_dir = 'smarty/cache';
return $mySmarty;
}
function assignSmartyVariables($mySmarty, $variablesToAssign) {
foreach ($variablesToAssign as $key => $value) {
$mySmarty->assign($key, $value);
}
}
function showCatchedExceptionTraceAndMessage(Exception $exc) {
echo "Ocurrió un error desconocido, por favor, notifique al departamento de sistemas.",
"<br>",
"<br>",
$exc->getTraceAsString(),
"<br>",
"<br>",
$exc->getMessage();
}
私が調査してきた、と私は知っているすべてはまで今、スマートなメソッドの存在があります:testI
Smartyのインストールのテスト...テストテンプレートディレクトリ... C:以下の情報を提供しますnstallの() を\ xamppの\ htdocsに\ \ Registro_de_Tramites \ Smartyのテンプレート\ OKですを開発。 コンパイルディレクトリのテスト... C:¥xampp¥htdocs¥develop¥Registro_de_Tramites¥smarty¥templates_cはOKです。 プラグインディレクトリをテスト中... C:¥xampp¥htdocs¥develop¥Registro_de_Tramites¥smarty¥libs¥pluginsは です。キャッシュディレクトリのテスト... C:¥xampp¥htdocs¥develop¥Registro_de_Tramites¥smarty¥cacheは正常です。 configsディレクトリのテスト... C:¥xampp¥htdocs¥develop¥Registro_de_Tramites¥smarty¥configはOKです。
テストsyspluginファイル... FAILED:LIBS/syspluginsから欠落していたファイル: smarty_internal_extension_codeframe.php、 smarty_internal_extension_config.php、 smarty_internal_extension_defaulttemplatehandler.php、 smarty_internal_filter_handler.php、 smarty_internal_function_call_handler.php、 smarty_internal_get_include_path.php。
プラグインファイルのテスト... ... OK テストが完了しました。
私は残りの部分から唯一のFAILEDを分けました。それはLIBS/syspluginsフォルダは、いくつかのPHPファイルを欠落しているが、からすべての繰り返しそれをダウンロードしているようで、ちょうど私が持っている同じファイルは、「私はすぐ内側、LIBSは私のプロジェクトにフォルダをコピーし、それをインストールするには...
を与えますスマート "フォルダ。
希望いくつかの助けを得るために:/