02/23: Smartyの設置方法

Category: PHP | Posted by: ayumi
本家サイトから、Smarty本体を落してきてください。
 ↓
解凍すると
 Smarty-2.*.*
 ├demo/
├libs/
├misc/
├unit_test/
  └その他ファイル
が現れますが、使うのは「libs」フォルダです。
 ↓
「libs」をサーバにあげます。
 ↓
次に「tpl」と「tmp」フォルダを作成します。「tmp」をパーミションを707にします。
 ↓
Smartyファイルの読み込み。
require_once("./libs/Smarty.class.php");

 ↓
クラスの呼び出し。
$mySmarty=new Smarty();

 ↓
各種ファイルの場所を指定
tplの読み込み先
$mySmarty->compile_dir = ("./tpl");

キャッシュの吐き出し先
$mySmarty->template_dir = ("./tmp");

変数を渡します。
$mySmarty->assign("test","Smarty設置テスト");

使用するtplを指定
$mySmarty->display("../tpl/home.tpl");

 ↓
完了


Comments

VjwUlvCOktp wrote (07/08 10:56:33):
uiUQrL <a href="http://lcutrmgyxuss.com/">lcutrmgyxuss</a>, [url=http://zdfbbsqdyvtt.com/]zdfbbsqdyvtt[/url], [link=http://gucgqnwzflxn.com/]gucgqnwzflxn[/link], http://waqrwpleslza.com/ VzUxYCfjw wrote (07/11 14:30:52):
gVM4px <a href="http://zxbrxpxwbwcf.com/">zxbrxpxwbwcf</a>, [url=http://umqyxbsjqiog.com/]umqyxbsjqiog[/url], [link=http://mpzvwgjwkeww.com/]mpzvwgjwkeww[/link], http://vlqxjzqfyokc.com/

Add Comment

Search

Navigation

<   2008-08   >
     12
3456789
10111213141516
17181920212223
24252627282930
31