Smartyのインストールの確認
■Smartyの動作確認
テンプレートSmartyをダンロードした後、任意のフォルダにインストールし終えたら、次の動作確認プログラム「5-5-1.php」を書き、起動させる。
「5-5-1.php」
//====================================================================
// ●: 5-5 Smarty バージョンチェック
//====================================================================
require_once("Smarty.class.php");
$smary = new Smarty;
echo "インストールしたSmartyのVersionは{$smary->_version}です";
?>
■エラー表示されたら
Smarty.class.phpの内容を変更する。
【Smarty.class.phpの変更】
/**
* This determines if debugging is enable-able from the browser.
*
- NONE => no debugging control allowed
- URL => enable debugging when SMARTY_DEBUG is found in the URL.
*
*
*
*
* @var string
*/
public $debugging_ctrl = 'NONE';
/*追加*/
public $_version = self::SMARTY_VERSION;
/**
* Name of debugging URL-param.
* Only used when $debugging_ctrl is set to 'URL'.
* The name of the URL-parameter that activates debugging.
*
* @var string
*/
public $smarty_debug_id = 'SMARTY_DEBUG';
■成功したら、下記のように表示される
OKなら→インストールしたSmartyのVersionは3.1.30です