概要
閲覧数:2312
投稿日:2013-08-05
更新日:2016-03-13
Smartyのテンプレートにincludeしたファイルを表示
・index.phpなど、Smarty呼び出すファイルでechoするやり方
・テンプレートへ渡す方法
コード
//index.phpなど、Smarty呼び出すファイルでechoするやり方
require_once('../../lib/set_include_path.php');
echo $header=file_get_contents("header.php",true);
//テンプレートへ渡す方法
$header=file_get_contents("header.php",true);
require("/virtual/(ユーザー名)/lib/smarty/Smarty.class.php");
$smarty = new Smarty();
$smarty->assign("header",$header);
$smarty->display("(テンプレートファイル名).html");