$smarty.now

CORESERVERSmarty

$smarty.now

 状態:不明  閲覧数:4,392  投稿日:2009-04-21  更新日:2010-08-08
Smarty.class.phpを相対パスでrequireするとPHPのdate_fomart()になってしまい、絶対パスでrequireするとSmartyの修飾子になった。

■ブラウザ/エラー表示
現在の時刻は
Warning: date_format() expects parameter 1 to be DateTime, integer given in /virtual/ユーザー名/public_html/ドメイン名/originalSample/programmed/now/templates_c/%%44^44A^44A0DD53%%sample.tpl.php on line 12
です。

■デバッグ/template_cディレクトリ内
<p>現在の時刻は<?php echo ((is_array($_tmp=$this->_tpl_vars['now'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%H:%M:%S") : date_format($_tmp, "%H:%M:%S")); ?>です。</p>

■Smartyライブラリアップロード
/virtual/ユーザー名/lib/
へSmartyライブラリをアップロードした。

■sample.php
define("SMARTY_DIR", "/usr/local/lib/php/Smarty/");
require_once(SMARTY_DIR . "Smarty.class.php");

define("SMARTY_DIR", "/virtual/ユーザー名/lib/smarty/");
require_once(SMARTY_DIR . "Smarty.class.php");


■参考URL
Smarty.class.phpを相対パスでrequireするとPHPのdate_fomart()になってしまい、絶対パスでrequireするとSmartyの修飾子になる
http://www.phppro.jp/qa/1211


Smarty