{"id":3914,"date":"2012-09-11T11:19:57","date_gmt":"2012-09-11T02:19:57","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=3914"},"modified":"2012-09-11T11:22:58","modified_gmt":"2012-09-11T02:22:58","slug":"php-%e3%83%86%e3%83%b3%e3%83%97%e3%83%ac%e3%83%bc%e3%83%88%e3%82%a8%e3%83%b3%e3%82%b8%e3%83%b3-smarty-%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=3914","title":{"rendered":"PHP \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3 Smarty \u4f7f\u7528\u65b9\u6cd5"},"content":{"rendered":"<p>\u6d41\u308c\u3067Smarty\u3092\u4f7f\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3057\u305f\u306e\u3067\u3001\u8272\u3005\u3068\u6b8b\u3057\u3066\u3044\u3051\u308c\u3070\u3088\u3044\u304b\u3068\u3002<\/p>\n<p>\u307e\u305a\u3001Smarty\u3068\u306f\u306a\u3093\u305e\u3088\uff1f\u306e\u3068\u3053\u308d\u304b\u3089\u3002<\/p>\n<p>\u7c21\u5358\u306b\u8a00\u3044\u307e\u3059\u3068PHP\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u3059\u3002\uff08\u304d\u3063\u3071\u308a\uff09<\/p>\n<p>PHP\u306b\u306fHTML\u5185\u306b\u30b3\u30fc\u30c9\u3092\u57cb\u3081\u8fbc\u3080\u3053\u3068\u304c\u51fa\u6765\u308b\u3068\u3044\u3046\u4ed6\u306e\u8a00\u8a9e\u306b\u306a\u3044\u7279\u5fb4\u3092\u6301\u3063\u3066\u3044\u307e\u3057\u3066\u3001\u521d\u5fc3\u8005\u3067\u3082\u6bd4\u8f03\u7684\u76f4\u611f\u7684\u306b\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u304c\u6545\u3001\u52d5\u7684\u306aWeb\u30da\u30fc\u30b8\u3084Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\u969b\u3001PHP \u306e\u8a00\u8a9e\u3092\u7528\u3044\u3089\u308c\u3066\u4f5c\u6210\u3055\u308c\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n<p>\u305d\u3093\u306aPHP\u306e\u8a00\u8a9e\u3092\u3082\u3063\u3068\u7c21\u5358\u306b\u77ed\u3044\u8a18\u8ff0\u3067\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u3088\u3046\u3067\u306f\u306a\u3044\u304b\uff01\u3063\u3066\u3044\u3046\u306e\u304cSmarty\u306b\u306a\u3063\u3061\u3083\u3044\u307e\u3059\u3002<\/p>\n<h4>Smarty\u3068\u306f\u306a\u3093\u305e\u3084<\/h4>\n<p>\u5148\u7a0b\u3082\u8ff0\u3079\u3055\u305b\u3066\u9802\u304d\u307e\u3057\u305f\u304c\u3001Smarty\u306fPHP\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u3067\u3059\u3002<\/p>\n<p>\u30ed\u30b8\u30c3\u30af\u3068\u30c7\u30b6\u30a4\u30f3\u306e\u5206\u96e2\u306e\u70ba\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u3067\u3001PHP\u306e\u304a\u624b\u8efd\u3055\uff0b\u4fdd\u5b88\u6027\u306b\u512a\u308c\u3066\u3044\u308b\u305f\u3081\u591a\u304f\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u00a0Andrei Zmievski\u304c\u793e\u5185\u7528\u306b\u958b\u767a\u3057\u305f\u300cSmartTemplate\u300d\u304c\u524d\u8eab\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u306e\u3088\u3046\u3067<!--?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?--> \u300c\u30b9\u30de\u30fc\u30c8(smart)\u300d\u306a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u3092\u3002\u3068\u3044\u3046\u610f\u5473\u5408\u3044\u3092\u8fbc\u3081\u3066Smarty\u3068\u540d\u4ed8\u3051\u305f\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u30b7\u30b9\u30c6\u30e0\u3092MVC\uff08<!--?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?--> \u300cModel\u300d(\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306a\u3069\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u3092\u6271\u3046\u8981\u7d20)\u300cView\u300d(\u51fa\u529b\u7d50\u679c\u306eHTML\u8868\u793a\u306a\u3069UI\u3092\u6271\u3046\u8981\u7d20)\u300cController\u300d(\u5165\u51fa\u529b\u3092\u5236\u5fa1\u3057Model\u3068View\u306e\u6a4b\u6e21\u3057\u3092\u884c\u3046\u8981\u7d20)\uff09\u306e3\u3064\u306b\u5206\u3051\u3066\u5b9f\u88c5\u3059\u308b\u65b9\u5f0f\u3067\u3001\u958b\u767a\u4f5c\u696d\u306e\u5206\u62c5\u3092\u5bb9\u6613\u306b\u3057\u3001\u4f5c\u696d\u9014\u4e2d\u306b\u767a\u751f\u3059\u308b\u306e\u4ed5\u69d8\u5909\u66f4\u306b\u3082\u6700\u5c0f\u9650\u306b\u3059\u308b\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u8a18\u8ff0\u304c\u3088\u308a\u5bb9\u6613\u306b\u306a\u308b\u4ed6\u306b\u3082\u300c\u9ad8\u901f\u3067\u52d5\u4f5c\u300d\u3059\u308b\u3068\u3044\u3046\u7279\u5fb4\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h4>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<p>\u516c\u5f0f\u30b5\u30a4\u30c8\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<p><strong>Smarty \u516c\u5f0f\u30b5\u30a4\u30c8<\/strong><\/p>\n<p><a href=\"http:\/\/www.smarty.net\/\" target=\"_blank\">http:\/\/www.smarty.net\/<\/a><\/p>\n<p><strong>Smarty \u516c\u5f0f\u30b5\u30a4\u30c8\uff08\u65e5\u672c\uff09<\/strong><\/p>\n<p><a href=\"http:\/\/www.smarty.net\/docsv2\/ja\/\">http:\/\/www.smarty.net\/docsv2\/ja\/<\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/d591fe5f28fcb817e9858b30dba952dc.png\" title=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2012-09-06 15.38.31\" width=\"713\" height=\"446\" class=\"alignnone  wp-image-3923\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/d591fe5f28fcb817e9858b30dba952dc.png 1019w, https:\/\/www.webcyou.com\/wp-content\/uploads\/d591fe5f28fcb817e9858b30dba952dc-300x187.png 300w\" sizes=\"auto, (max-width: 713px) 100vw, 713px\" \/><\/p>\n<p><strong>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/strong><\/p>\n<p><a href=\"http:\/\/www.smarty.net\/download\" target=\"_blank\">http:\/\/www.smarty.net\/download<\/a><\/p>\n<p>\u4ee5\u4e0b\u306e\u9805\u76ee\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>tar\u30d5\u30a1\u30a4\u30eb\u304bzip\u30d5\u30a1\u30a4\u30eb\u304b\u3082\u9078\u629e\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/bb51ba0e74c7f247d90d8df3e7615efe.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/bb51ba0e74c7f247d90d8df3e7615efe.png\" title=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2012-09-06 15.43.18\" width=\"563\" height=\"383\" class=\"alignnone  wp-image-3924\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/bb51ba0e74c7f247d90d8df3e7615efe.png 626w, https:\/\/www.webcyou.com\/wp-content\/uploads\/bb51ba0e74c7f247d90d8df3e7615efe-300x203.png 300w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/><\/a><\/p>\n<p>2012\u5e749\u6708\u73fe\u5728\u3060\u3068\u30013.1.11\u304c\u6700\u65b0\u3067\u3059\u304b\u306d\u3002\u300cSmarty-3.1.10.tar.gz\u300d\u304b\u300cSmarty-3.1.zip\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n<h4>\u30bb\u30c3\u30c6\u30a3\u30f3\u30b0<\/h4>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3089\u3001\u4f7f\u7528\u51fa\u6765\u308b\u3088\u3046\u306b\u30bb\u30c3\u30c6\u30a3\u30f3\u30b0\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u958b\u767a\u74b0\u5883\u3092\u4f5c\u308b\u305f\u3081MAMP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002\uff08MAC\uff09<\/p>\n<p>MAMP\u306e\u30bb\u30c3\u30c6\u30a3\u30f3\u30b0\u306f\u3053\u3061\u3089\u300c<a href=\"https:\/\/www.webcyou.com\/?p=752\">MAMP\u306e\u8a2d\u5b9a\u65b9\u6cd5<\/a>\u300d\u3092\u53c2\u7167\u306b\u3002<\/p>\n<p>Smarty\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001\u5c55\u958b\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Smarty-v.v.vv<\/p>\n<p>|-change_log.txt \u7b49<\/p>\n<p>|-libs\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-plugins\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-sysplugins\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-sysplugins\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-SmartyBC.class.php<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-Smarty.class.php<\/p>\n<p>|-demo\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|-cache\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|-configs\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|-plugins\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|-templates\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|-templates_c\/<\/p>\n<div><strong>MAMP\u3067\u4f7f\u7528\u3059\u308b\u969b\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\uff09<\/strong><\/div>\n<div>\/Applications\/MAMP\/bin\/php\/php5.3.6\/lib\/php<\/div>\n<div><\/div>\n<div>\u2191\u3053\u3061\u3089\u306b\u5148\u307b\u3069\u89e3\u51cd\u3057\u305f\u300cSmarty-v.v.vv\u300d\u3092\u914d\u7f6e\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u5fc5\u8981\u306a\u306e\u306f\u300clibs\u300d\u306e\u30d5\u30a1\u30a4\u30eb\u3068\u306a\u308a\u307e\u3059\u3002<\/div>\n<div>\n<p>|-libs\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-plugins\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-sysplugins\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-sysplugins\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-SmartyBC.class.php<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-Smarty.class.php<\/p>\n<\/div>\n<p>\u300cSmarty-v.v.vv\u300d\u3092\u300cSmarty\u300d\u306b\u30ea\u30cd\u30fc\u30e0\u3057\u3001\u76f4\u4e0b\u306b\u300clibs\u300d\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304d\u307e\u3059\u3002<\/p>\n<p><strong>php.ini\u306e\u5909\u66f4<\/strong><\/p>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\uff1eMAMP&gt;conf&gt;php5.3&gt;conf \u5185\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308bphp.ini\u306e\u5909\u66f4\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\uff12\uff17\uff17\u884c\u76ee\u3000display_errors = Off\u3000\u3092\u3000display_errors = On\u3000\u306b\u5909\u66f4<br \/>\uff12\uff18\uff17\u884c\u76ee\u3000log_errors = Off\u3000\u3092\u3000log_errors = On\u3000\u306b\u5909\u66f4<\/p>\n<p>\u203b\u5909\u66f4\u3057\u306a\u304f\u3066\u3082\u4f7f\u7528\u3067\u304d\u307e\u3059\u304c\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3060\u3068\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3057\u306a\u3044\u8a2d\u5b9a\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3055\u305b\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u3001\/Applications\/MAMP\/htdocs\/\u306bindex.php\u3092\u4f5c\u6210\u3057\u3001\u30c6\u30b9\u30c8\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>Smarty \u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u306fSmarty.class.php\u3092\u8aad\u307f\u8fbc\u307e\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3001Smarty.class.php\u3092require_once\u3067\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&lt;!?php\r\nrequire_once('Smarty\/Smarty.class.php');\r\n$smary = new Smarty;\r\n?&gt;<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u5b9a\u7fa9\u3057\u3066\u8aad\u307f\u8fbc\u307f\u65b9<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&lt;?php \r\ndefine('SMARTY_DIR',\u00a0'\/usr\/local\/lib\/Smarty\/libs\/'\u00a0);\r\nrequire_once(\u00a0SMARTY_DIR\u00a0.\u00a0'Smarty.class.php'\u00a0);\r\n$smarty\u00a0=\u00a0new\u00a0Smarty();\r\n?&gt;<\/pre>\n<p>&nbsp;<\/p>\n<p>http:\/\/localhost:8888\/<\/p>\n<p>\u3092\u958b\u304d\u3001\u7279\u306b\u554f\u984c\u306a\u3051\u308c\u3070\u30a8\u30e9\u30fc\u8868\u793a\u3082\u51fa\u305a\u3001\u771f\u3063\u767d\u306a\u753b\u9762\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>Smarty \u3092\u5229\u7528\u3059\u308b\u5834\u5408\u3001<code>libs<\/code>\u00a0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306e\u69cb\u6210\u304c\u6539\u5909\u3055\u308c\u3066\u3044\u306a\u3051\u308c\u3070\u3001<\/p>\n<p>\u57fa\u672c\u7684\u306bSmarty.class.php\u30d5\u30a1\u30a4\u30eb\u3055\u3048\u898b\u3064\u3051\u3089\u308c\u308c\u3070\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u4e00\u5fdcMAMP\u3067\u306e\u30bb\u30c3\u30c6\u30a3\u30f3\u30b0\u306fOK\u3067\u3059\u306d\u3002<\/p>\n<p>\u30e9\u30a4\u30d6\u30e9\u30ea\u30d5\u30a1\u30a4\u30eb\u304c\u6b63\u5e38\u306b\u8a2d\u7f6e\u3067\u304d\u305f\u306a\u3089\u3001\u6b21\u306f\u3001\u5b9f\u969b\u306b\u4f5c\u6210\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u305f\u3081\u306b Smarty\u7528\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u8a2d\u5b9a\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>smarty\u3067\u5fc5\u8981\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<p><strong>\u30fb\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/strong><br \/><strong>\u30fb\u30b3\u30f3\u30d1\u30a4\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/strong><br \/><strong>\u30fb\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/strong><br \/><strong>\u30fb\u30ad\u30e3\u30c3\u30b7\u30e5\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/strong><\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u89e3\u51cd\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306b\u542b\u307e\u308c\u3066\u3044\u308b\u300cdemo\u300d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u78ba\u8a8d\u3057\u3066\u3082\u3089\u3048\u308c\u3070\u5206\u304b\u308b\u306e\u3067\u3059\u304c\u3001<\/p>\n<p>\u4ee5\u4e0b\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u3092\u4f5c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>templates\u30fb\u30fb\u30fb\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/strong><\/p>\n<p><strong>templates_c\u30fb\u30fb\u30b3\u30f3\u30d1\u30a4\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/strong><\/p>\n<p><strong>configs\u30fb\u30fb\u30fb\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/strong><\/p>\n<p><strong>cache\u30fb\u30fb\u30fb\u30ad\u30e3\u30c3\u30b7\u30e5\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/strong><\/p>\n<p>\u8a73\u7d30\u306f\u305d\u308c\u305e\u308c\u3001<\/p>\n<p><strong>templates\u30fb\u30fb\u30fb<\/strong>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u683c\u7d0d\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3002\u5404\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u62e1\u5f35\u5b50\u306f\u00a0<code>.tpl<\/code>\u3002<\/p>\n<p><strong>templates_c\u30fb\u30fb<\/strong>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u5229\u7528\u3057\u3066 php \u30d5\u30a1\u30a4\u30eb\u306b\u5c55\u958b\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u683c\u7d0d\u3059\u308b\u30ad\u30e3\u30c3\u30b7\u30e5\u7528\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3002<\/p>\n<p>Web\u30b5\u30fc\u30d0\u30fc(httpd)\u304c\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u306e\u3067\u3001httpd.conf \u3067\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b Web\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3059\u308b\u30a2\u30ab\u30a6\u30f3\u30c8\uff08User, Group\uff09\u304c\u66f8\u304d\u8fbc\u307f\u3067\u304d\u308b\u30aa\u30fc\u30ca\u30fc\u3068\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u306b\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p><strong>configs\u30fb\u30fb\u30fb<\/strong>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306a\u3069\u3092\u5229\u7528\u3059\u308b\u969b\u306e\u8a2d\u5b9a\u3084\u521d\u671f\u5024\u306a\u3069\u3092\u767b\u9332\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u683c\u7d0d\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3002 \u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u304c test.conf \u3068\u3044\u3046\u540d\u524d\u306e\u5834\u5408\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<p><strong>cache\u30fb\u30fb\u30fb<\/strong>built-in caching\u3068\u3044\u3046\u6a5f\u80fd\u3092\u6709\u52b9($smarty-&gt;caching = true;)\u306b\u3057\u305f\u969b\u306b\u4f7f\u7528\u3055\u308c\u308b\u30ad\u30e3\u30c3\u30b7\u30e5\u7528\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3002Web\u30b5\u30fc\u30d0\u30fc(httpd)\u304c\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u306e\u3067\u3001httpd.conf \u3067\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b Web\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3059\u308b\u30a2\u30ab\u30a6\u30f3\u30c8\uff08User, Group\uff09\u304c\u66f8\u304d\u8fbc\u307f\u3067\u304d\u308b\u30aa\u30fc\u30ca\u30fc\u3068\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u306b\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5148\u307b\u3069\u4f5c\u6210\u3057\u305findex.php\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\/Applications\/MAMP\/htdocs\/<\/p>\n<p><strong>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/strong><\/p>\n<p>|-htdocs\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-index.php<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-templates\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-templates_c\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-configs\/<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 |-cache\/<\/p>\n<p>\u305d\u308c\u3067\u306f\u30c6\u30b9\u30c8\u3068\u3057\u3066\u3001templates\/\u306btest.tpl\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>test.tpl\u3092\u4f5c\u6210\u3057\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8a18\u8ff0\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\u4eca\u65e5\u306f{$smarty.now|date_format:'%Y\u5e74%m\u6708%d\u65e5'}\u3067\u3059\u3002<\/pre>\n<p>&nbsp;<\/p>\n<p>\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30eb\u30fc\u30c8\u306b\u7f6e\u3044\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$smarty-&gt;display('test.tpl');<\/pre>\n<p>&nbsp;<\/p>\n<p>\u3092\u8ffd\u52a0\u3057\u3066templates\/\u306b\u914d\u7f6e\u3057\u305ftest.tpl\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n<p><strong>index.php<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&lt;?php \r\nini_set( 'display_errors', 1 );\r\nrequire_once('Smarty\/Smarty.class.php');\r\n$smarty = new Smarty();\r\n$smarty-&gt;template_dir = 'templates\/';\r\n$smarty-&gt;compile_dir = 'templates_c\/';\r\n$smarty-&gt;config_dir = 'configs\/';\r\n$smarty-&gt;cache_dir = 'cache\/';\r\n\r\n$smarty-&gt;display('test.tpl');\r\n?&gt;<\/pre>\n<p>&nbsp;<\/p>\n<p>\u4eca\u65e5\u306f2012\u5e7409\u670811\u65e5\u3067\u3059\u3002<\/p>\n<p>\u3068\u65e5\u4ed8\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6d41\u308c\u3067Smarty\u3092\u4f7f\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3057\u305f\u306e\u3067\u3001\u8272\u3005\u3068\u6b8b\u3057\u3066\u3044\u3051\u308c\u3070\u3088\u3044\u304b\u3068\u3002 \u307e\u305a\u3001Smarty\u3068\u306f\u306a\u3093\u305e\u3088\uff1f\u306e\u3068\u3053\u308d\u304b\u3089\u3002 \u7c21\u5358\u306b\u8a00\u3044\u307e\u3059\u3068PHP\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u3059\u3002\uff08\u304d\u3063\u3071\u308a\uff09 PHP\u306b\u306fHTML\u5185\u306b\u30b3\u30fc\u30c9\u3092\u57cb\u3081\u8fbc\u3080 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-3914","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/3914","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3914"}],"version-history":[{"count":29,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/3914\/revisions"}],"predecessor-version":[{"id":3947,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/3914\/revisions\/3947"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3914"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3914"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}