Skip to content

Instantly share code, notes, and snippets.

@sotarok
Created December 22, 2008 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sotarok/38884 to your computer and use it in GitHub Desktop.
Save sotarok/38884 to your computer and use it in GitHub Desktop.
<?php
define ('SMARTY_DIR', '/path/to/smarty/'); // 設置したSmarty本体へのパスを設定します(絶対パス)
require_once 'Smarty/Smarty.class.php';
$smarty = new Smarty();
$smarty->template_dir = '/path/to/templates/'; // 設置したtemplates への絶対パス
$smarty->compile_dir = '/path/to/templates_c/'; // 設置したtemplates_cへの絶対パス
$smarty->display('index.tpl'); // こうすることで、templatesディレクトリにある index.tpl を読み込み、出力する
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment