2007年8月10日金曜日

Smartyのディレクトリ構成

Smartyは、以下のようなディレクトリ構成で配置する

<htdocs>
+-- <smartyapplication>
+-- <templates>
+-- <templates_c>
+-- <config>
+-- <cache>



phpをここにおく。
templateは<templates>におく。
とりあえず、今はこれだけ。
<templates_c>は、コンパイルされたファイルが置かれる。

これらのディレクトリをSmartyに教えてあげるには
smartyオブジェクトを生成後に指定すればよい。


// エンジンの指定
require_once('Smarty/Smarty.class.php');

// オブジェクトの作成
$smarty = new Smarty;

// テンプレートファイル
$smarty->template_dir = './templates/';
$smarty->compile_dir = './templates_c/';
$smarty->config_dir = './configs/';

1 件のコメント:

Telefone VoIP さんのコメント...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Telefone VoIP, I hope you enjoy. The address is http://telefone-voip.blogspot.com. A hug.