【PHP】 Smarty 隔離スレ 【テンプレート】
■ このスレッドは過去ログ倉庫に格納されています
0146nobodyさん
2008/07/21(月) 01:40:20ID:8uak49aQ<?php
require_once("Smarty/Smarty.class.php");
classMySmartyextendsSmarty {
publicfunction__construct() {
$this->Smarty();
$this->template_dir="./data/templates";
$this->compile_dir="./data/templates_c";
}
}
?>
■ test.php(MySmarty.class.php と同じディレクトリ) → 正常に動作
<?php
require_once( './MySmarty.class.php' );
$o_smarty = new MySmarty();
$o_smarty->display( "main.tpl" );
?>
■ dir.php(MySmarty.class.php の直下のフォルダ) → エラー
Warning: Smarty error: unable to read resource: "main.tpl" in C:\hoge\Smarty\Smarty.class.php on line 1092
<?php
require_once( '../MySmarty.class.php' );
$o_smarty = new MySmarty();
$o_smarty->display( "main.tpl" );
?>
これは仕様なの?
■ このスレッドは過去ログ倉庫に格納されています