(1)
app/vendorにSmartyを配置。

(2)
app/config/config.phpの'always_load'の'packages'に'parser'を追加。
'always_load' => array(
/**
* These packages are loaded on Fuel's startup. You can specify them in
* the following manner:
*
* array('auth'); // This will assume the packages are in PKGPATH
*
* // Use this format to specify the path to the package explicitly
* array(
* array('auth' => PKGPATH.'auth/')
* );
*/
'packages' => array(
//'orm',
'parser',
),(3)アクセスするコントローラを修正。
今回は、DLしたFuelPHPに入っているdefaultのコントローラである、
app/classes/controller/welcome.phpを修正。
return Response::forge(View::forge('welcome/index'));を$data = array(
'title' => 'TITLE',
'body' => 'BODY',
);
return Response::forge(View_Smarty::forge('welcome/index', $data));にする。(4)
viewファイルの作成。
app/views/welcomeにindex.smartyを作成。
<!DOCTYPE html>
<html>
<head>
<title>{$title}</title>
</head>
<body>
<p>{$body}</p>
</body>
</html>(5)
コントローラにアクセス。
No comments:
Post a Comment