2008年11月20日木曜日

cakephp: レイアウトの使用

レイアウトの使用
/app/views/layouts/temp.thtml

<html>
<head>
<title><?=$title_for_layout?></title>
</head>
<body>
<?=$content_for_layout?>
</body>
</html>

コントローラー内
var $layout = "temp";
functon hoge(){
$this->pageTitle = "タイトル";
}

エレメントの使用
/app/views/elements/ele.thtml

テンプレート内
<?=$this->renderElement("ele",array("message" => "メッセージ"))?>

0 件のコメント: