ホームページ >バックエンド開発 >PHPチュートリアル >Smarty関連の問題については、お問い合わせください。ありがとう!

Smarty関連の問題については、お問い合わせください。ありがとう!

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBオリジナル
2016-06-13 13:26:53985ブラウズ

Smarty の問題については、専門家の指導を求めてください。 !ありがとう! !
専門家のアドバイスをお願いします!ありがとうございました! ! !

smarty に初めて触れたとき、初めて使用したときにブラウザに次のようなエラーが表示されました。しかし、更新するとプロンプト メッセージは消え、ブラウザは引き続き出力しました。何もない!
厳格な標準: strftime() [function.strftime]: システムのタイムゾーン設定に依存するのは安全ではありません。
TZ 環境変数または date_default_timezone_set() 関数を使用してください。 🎜>これらの方法のいずれかを使用してもこの
警告が表示される場合は、タイムゾーン識別子のスペルを間違えている可能性が高く、
C で「8.0/no DST」の代わりに
「UTC」を選択しました。 :AppServwwwsmartySmartySmarty_Compiler.class.php 400 行目


設定は次のとおりです:
smarty_inc.php
include_once("Smarty/Smarty.class.php" ); //smarty クラス ファイルが含まれます
$smarty = new Smarty(); //smarty インスタンス オブジェクトを作成します $smarty
$smarty->config_dir="Smarty/Config_File.class.php";変数
$smarty->caching=false; //プロジェクトのデバッグ中にキャッシュを使用するかどうか。
$smarty->template_dir = "./templates";テンプレートディレクトリ
$smarty->compile_dir = "./templates_c"; //コンパイルディレクトリを設定します
$smarty->cache_dir = "./smarty_cache" //キャッシュフォルダー
; ---- --------------------------------------
//左右の境界文字、デフォルトは{}ですが、実際のアプリケーションではJavaScriptと競合しやすい
//--------------------- - -------------------------
$smarty->left_delimiter = "<{";
$smarty- > ;right_delimiter = "}>";
?>

index.php
include("Smarty_inc.php");
$name= 最初Smarty を使用します";
$smarty->assign("title",$naem);
$smarty->display("index.html");
?>
index.html


<title><br><body><br><b>< $title}></b><br></body><br></html><br><br><br><br><br><br>----- -解決策------------------<br><br> タイムゾーンが設定されておらず、開かれた php.ini ファイルは <font color="#e78608">date.timezone= に変更されます。 Asia/Shanghai に移動し、Web サーバーを再起動します。 </font><br>------解決策---------<br><br>これは、PHP でデフォルトのタイムゾーンが設定されていないためですファイルの先頭に次を追加します: <font color="#e78608"></font>PHP コード<br> date_default_timezone_set('PRC'); <br></p> <dl class="code">------解決策---------<pre class="brush:php;toolbar:false"><br>またはこの<font color="#e78608"></font>PHP コード<br> date_default_timezone_set('アジア/上海'); include_once("Smarty/Smarty.class.php"); ... <br></pre> <dl class="code">------解決策---------<pre class="brush:php;toolbar:false"><br>smarty のせいではなく、あなたのせいです。php 環境は次のとおりです。正しく設定されていません <font color="#e78608"> php.ini の date.timezone でタイムゾーンを設定します </font> またはプログラムの date_default_timezone_set 関数でタイムゾーンを設定します <br><br></pre> </dl> </dl></div><div class="nphpQianMsg"><div class="clear"></div></div><div class="nphpQianSheng"><span>声明:</span><div>この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。</div></div></div><div class="nphpSytBox"><span>前の記事:<a class="dBlack" title="$HTTP_POST_FILES について質問してください" href="https://m.php.cn/ja/faq/220692.html">$HTTP_POST_FILES について質問してください</a></span><span>次の記事:<a class="dBlack" title="$HTTP_POST_FILES について質問してください" href="https://m.php.cn/ja/faq/220694.html">$HTTP_POST_FILES について質問してください</a></span></div><div class="nphpSytBox2"><div class="nphpZbktTitle"><h2>関連記事</h2><em><a href="https://m.php.cn/ja/article.html" class="bBlack"><i>続きを見る</i><b></b></a></em><div class="clear"></div></div><ins class="adsbygoogle" style="display:block" data-ad-format="fluid" data-ad-layout-key="-6t+ed+2i-1n-4w" data-ad-client="ca-pub-5902227090019525" data-ad-slot="8966999616"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script><ul class="nphpXgwzList"><li><b></b><a href="https://m.php.cn/ja/faq/1.html" title="cURL を使用して PHP で Get リクエストと Post リクエストを実装する方法" class="aBlack">cURL を使用して PHP で Get リクエストと Post リクエストを実装する方法</a><div class="clear"></div></li><li><b></b><a href="https://m.php.cn/ja/faq/1.html" title="cURL を使用して PHP で Get リクエストと Post リクエストを実装する方法" class="aBlack">cURL を使用して PHP で Get リクエストと Post リクエストを実装する方法</a><div class="clear"></div></li><li><b></b><a href="https://m.php.cn/ja/faq/1.html" title="cURL を使用して PHP で Get リクエストと Post リクエストを実装する方法" class="aBlack">cURL を使用して PHP で Get リクエストと Post リクエストを実装する方法</a><div class="clear"></div></li><li><b></b><a href="https://m.php.cn/ja/faq/1.html" title="cURL を使用して PHP で Get リクエストと Post リクエストを実装する方法" class="aBlack">cURL を使用して PHP で Get リクエストと Post リクエストを実装する方法</a><div class="clear"></div></li><li><b></b><a href="https://m.php.cn/ja/faq/2.html" title="正規表現内のすべての式記号 (概要)" class="aBlack">正規表現内のすべての式記号 (概要)</a><div class="clear"></div></li></ul></div></div><ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="5027754603"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script><footer><div class="footer"><div class="footertop"><img src="/static/imghwm/logo.png" alt=""><p>福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!</p></div><div class="footermid"><a href="https://m.php.cn/ja/about/us.html">私たちについて</a><a href="https://m.php.cn/ja/about/disclaimer.html">免責事項</a><a href="https://m.php.cn/ja/update/article_0_1.html">Sitemap</a></div><div class="footerbottom"><p> © php.cn All rights reserved </p></div></div></footer><script>isLogin = 0;</script><script type="text/javascript" src="/static/layui/layui.js"></script><script type="text/javascript" src="/static/js/global.js?4.9.47"></script></div><script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script><link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css' type='text/css' media='all'/><script type='text/javascript' src='/static/js/viewer.min.js?1'></script><script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script><script>jQuery.fn.wait = function (func, times, interval) { var _times = times || -1, //100次 _interval = interval || 20, //20毫秒每次 _self = this, _selector = this.selector, //选择器 _iIntervalID; //定时器id if( this.length ){ //如果已经获取到了,就直接执行函数 func && func.call(this); } else { _iIntervalID = setInterval(function() { if(!_times) { //是0就退出 clearInterval(_iIntervalID); } _times <= 0 || _times--; //如果是正数就 -- _self = $(_selector); //再次选择 if( _self.length ) { //判断是否取到 func && func.call(_self); clearInterval(_iIntervalID); } }, _interval); } return this; } $("table.syntaxhighlighter").wait(function() { $('table.syntaxhighlighter').append("<p class='cnblogs_code_footer'><span class='cnblogs_code_footer_icon'></span></p>"); }); $(document).on("click", ".cnblogs_code_footer",function(){ $(this).parents('table.syntaxhighlighter').css('display','inline-table');$(this).hide(); }); $('.nphpQianCont').viewer({navbar:true,title:false,toolbar:false,movable:false,viewed:function(){$('img').click(function(){$('.viewer-close').trigger('click');});}}); </script></body><!-- Matomo --><script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="https://tongji.php.cn/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '9']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); </script><!-- End Matomo Code --></html>