{"id":10359,"date":"2017-08-09T19:48:26","date_gmt":"2017-08-09T10:48:26","guid":{"rendered":"http:\/\/www.spiceworks.co.jp\/blog\/?p=10359"},"modified":"2024-05-20T18:09:13","modified_gmt":"2024-05-20T09:09:13","slug":"php%e3%81%a7smarty%e3%81%ae%e4%bb%a3%e3%82%8f%e3%82%8a%e3%81%abtwig%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f","status":"publish","type":"post","link":"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359","title":{"rendered":"PHP\u3067Smarty\u306e\u4ee3\u308f\u308a\u306bTwig\u3092\u4f7f\u3063\u3066\u307f\u305f"},"content":{"rendered":"<p><a href=\"https:\/\/www.spiceworks.co.jp\/blog\/wp-content\/uploads\/2017\/04\/image.png\" data-rel=\"lightbox-gallery-STA4yQWo\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-single-thumbnail wp-image-10729\" src=\"https:\/\/www.spiceworks.co.jp\/blog\/wp-content\/uploads\/2017\/04\/image-636x310.png\" alt=\"image\" width=\"636\" height=\"310\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u521d\u3081\u307e\u3057\u3066\u3001\u30b9\u30d1\u30a4\u30b9\u30ef\u30fc\u30af\u30b9\u306e\u30a8\u30f3\u30b8\u30cb\u30a2\u3068\u3057\u30662016\u5e7410\u6708\u306b\u5165\u793e\u3057\u3066\u3044\u307e\u3057\u305f\u3001\u9ad9\u6a4b\u3067\u3059\u3002<br \/>\n\u521d\u3081\u3066\u3053\u3061\u3089\u306e\u30d6\u30ed\u30b0\u3092\u66f8\u304f\u306e\u3067\u3001\u6700\u521d\u306b\u81ea\u5df1\u7d39\u4ecb\u304b\u3089\u5165\u308a\u307e\u3059\u306d\u3002<\/p>\n<h2>\u25c7\u81ea\u5df1\u7d39\u4ecb<\/h2>\n<p>\u3010\u540d\u524d\u3011\u9ad9\u6a4b<br \/>\n\u3010\u597d\u304d\u306a\u3082\u306e\u3011\u30b2\u30fc\u30e0\u5168\u822c\uff08\u7279\u306b\u30b9\u30d7\u30e9\u30c8\u30a5\u30fc\u30f3\uff09<br \/>\n\u3010\u8da3\u5473\u3011\u30a2\u30cb\u30e1\u3001\u6d0b\u753b\u3001\u6d77\u5916\u30c9\u30e9\u30de\u3092\u898b\u308b\u306e\u304c\u3081\u3061\u3083\u304f\u3061\u3083\u597d\u304d\u3067\u3059\u3002<br \/>\n\u3010\u30b9\u30ad\u30eb\u3011PHP\u30c1\u30e7\u30c3\u30c8\u30ab\u30b1\u30eb\u3001html\u30c1\u30e7\u30c3\u30c8\u30ef\u30ab\u30eb\u3001CSS\u30c1\u30e7\u30c3\u30c8\u30ef\u30ab\u30eb\u3001\u666e\u901a\u514d\u8a31\uff08MT\uff09\u3001\u82f1\u691c\u6e96\u4e8c\u7d1a<\/p>\n<p>\u30b9\u30d7\u30e9\u30c8\u30a5\u30fc\u30f3\u306f\u597d\u304d\u3059\u304e\u3066\u30d7\u30ec\u30a4\u6642\u9593\u304c\u3007\u3007\u3007\u3007\u6642\u9593\u3092\u8d85\u3048\u3066\u307e\u3057\u305f\u3002<br \/>\n2\u304c\u697d\u3057\u307f\u3067\u3059\u3002Switch\u3082\u8cb7\u3044\u307e\u3057\u305f\u3002<\/p>\n<h2>\u25c7\u7d4c\u7def<\/h2>\n<p>&nbsp;<\/p>\n<p>\u5f0a\u793e\u3067\u306f\u57fa\u672c\u7684\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306bPHP\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Ruby\u3092\u52c9\u5f37\u4e2d\u3068\u3044\u3046\u72b6\u614b\u3067\u5165\u793e\u3057\u305f\u306e\u3067\u3001\u6700\u521d\u306f\u30bb\u30df\u30b3\u30ed\u30f3\u304c\u90aa\u9b54\u3067\u4ed5\u65b9\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u304c\u3001<br \/>\n\u4eca\u3067\u306f\u30bb\u30df\u30b3\u30ed\u30f3\u541b\u304c\u3044\u306a\u3044\u3068\u843d\u3061\u7740\u304b\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u2026\u3002<\/p>\n<p>\u6700\u8fd1\u306fRuby\u306a\u3069\u306e\u30e2\u30c0\u30f3\u306a\u8a00\u8a9e\u3092\u4f7f\u3063\u3066\u3044\u308b\u4f1a\u793e\u3055\u3093\u304c\u304b\u306a\u308a\u591a\u304f\u898b\u53d7\u3051\u3089\u308c\u3001PHP\u306f\u8ca0\u306e\u907a\u7523\u6271\u3044\u3055\u308c\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002<br \/>\n\u3057\u304b\u3057\u3001Laravel\u3001cakePHP\u306a\u3069\u3067\u6709\u540d\u306a\u30b5\u30fc\u30d3\u30b9\u3092\u4f5c\u3089\u308c\u3066\u3044\u308b\u4f1a\u793e\u3055\u3093\u3082\u591a\u3044\u3067\u3059\u3057\u3001PHP7\u7cfb\u306f\u6614\u3068\u306f\u6bd4\u3079\u7269\u306b\u306a\u3089\u306a\u3044\u304f\u3089\u3044\u4fbf\u5229\u306b\u306a\u3063\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\n\u5f0a\u793e\u3067\u3082\u5c11\u3057\u5927\u304d\u3081\u306e\u6848\u4ef6\u306b\u306a\u3063\u3066\u304d\u305f\u3089Laravel\u3092\u53d6\u308a\u5165\u308c\u3089\u308c\u305f\u3089\u3044\u3044\u306a\u3041\u3068\u52dd\u624b\u306b\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3042\u3068\u3001PHP\u306e\u30de\u30b9\u30b3\u30c3\u30c8\u3067\u3042\u308belePHPant\u3061\u3083\u3093\u3082\u610f\u5916\u3068\u304b\u308f\u3044\u3044\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u4eca\u56de\u3001\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u7d44\u3080\u307b\u3069\u306e\u898f\u6a21\u611f\u3067\u306f\u7121\u3044\u3051\u3069\u751f\u306ePHP\u3092\u66f8\u304f\u306e\u306f\u3081\u3093\u3069\u304f\u3055\u3044\u306a\u3041\u3068\u3044\u3046\u5834\u9762\u3067\u3001PHP\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u3067\u3042\u308bTwig\u3092\u4f7f\u3063\u305f\u306e\u3067\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h5>Twig |\u00a0The flexible, fast, and secure<br \/>\ntemplate engine for PHP<\/h5>\n<h5>https:\/\/twig.sensiolabs.org\/<\/h5>\n<p>&nbsp;<\/p>\n<p>\u672c\u5f53\u306fBlade\u3092\u4f7f\u3044\u305f\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001Laravel\u306b\u4f9d\u5b58\u3057\u3066\u3044\u3066\u3001\u4e14\u3064Laravel\u3067\u7d44\u3080\u898f\u6a21\u3067\u3082\u7121\u304b\u3063\u305f\u305f\u3081\u5358\u4f53\u3067\u5c0e\u5165\u304c\u53ef\u80fd\u306aTwig\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u25c7\u5c0e\u5165\u65b9\u6cd5<\/h2>\n<h3>\u25a0composer\u306e\u5c0e\u5165<\/h3>\n<p>Twig\u306fcomposer\u3092\u901a\u3057\u3066\u7c21\u5358\u306b\u5c0e\u5165\u3067\u304d\u307e\u3059\u3002<br \/>\n\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5358\u4f4d\u3067\u306e\u5c0e\u5165\u304c\u53ef\u80fd\u306e\u305f\u3081\u3001Twig\u3068composer\u3092\u5229\u7528\u3059\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30d5\u30a9\u30eb\u30c0\u3060\u3051\u306b\u3076\u3061\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u50d5\u306e\u74b0\u5883\u3067\u306fXAMPP\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u306e\u3067\u3001<br \/>\nC:\\xampp\\htdocs\\twigSample<br \/>\n\u3068\u3044\u3046\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5185\u306b\u79fb\u52d5\u3057\u3066<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$curl -s http:\/\/getcomposer.org\/installer | php\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n All settings correct for using Composer\r\n Downloading...\r\n\r\nComposer (version 1.4.1) successfully installed to: C:\\xampp\\htdocs\\twigSample\\composer.phar\r\n Use it: php composer.phar\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u3068\u3001composer.phar\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u3067composer\u306f\u5c0e\u5165\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u25a0Twig\u306e\u5c0e\u5165<\/h3>\n<p>Twig\u306e2.x\u7cfb\u306fPHP7.0.0\u4ee5\u4e0a\u3092\u5fc5\u8981\u3068\u3057\u307e\u3059\u3002<br \/>\n\u50d5\u306e\u4f1a\u793ePC\u74b0\u5883\u3067\u306fWindows\u3067PHP5.6.24\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u305f\u3081\u30011.x\u7cfb\u3092\u5c0e\u5165\u3057\u307e\u3059\u3002<\/p>\n<p>PHP7.0.0\u4ee5\u4e0a\u3092\u4f7f\u3063\u3066\u3044\u308b\u65b9\u306f2.x\u7cfb\u3067\u554f\u984c\u306a\u3044\u3067\u3059\u3057\u3001Mac\u3092\u4f7f\u3063\u3066\u3044\u308b\u65b9\u306fHomebrew\u3067phpenv\u3092\u5c0e\u5165\u3057\u3066\u3042\u3052\u308c\u3070\u7c21\u5358\u306bPHP\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5207\u308a\u66ff\u3048\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$composer require twig\/twig:~1.0\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nphp &quot;C:\\xampp\\php\\composer.phar&quot; require twig\/twig:~1.0\r\n.\/composer.json has been created\r\nLoading composer repositories with package information\r\nUpdating dependencies (including require-dev)\r\nPackage operations: 1 install, 0 updates, 0 removals\r\n- Installing twig\/twig (v1.33.2) Downloading: 100%\r\nWriting lock file\r\nGenerating autoload files\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u8272\u3005\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u304c\u3001<\/p>\n<p>&nbsp;<\/p>\n<p>twigSample<br \/>\n&#8212; vendor<br \/>\n&#8212;- composer<br \/>\n&#8212;- twig<br \/>\n&#8212; autoload.php<br \/>\n&#8212; composer.json<br \/>\n&#8212; composer.lock<br \/>\n&#8212; composer.phar<\/p>\n<p>&nbsp;<\/p>\n<p>\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308c\u3070\u5c0e\u5165\u5b8c\u4e86\u3067\u3059\u3002\u51c4\u304f\u7c21\u5358\u3067\u3059\u3002<\/p>\n<p>Twig\u306fSymfony\u3067\u5229\u7528\u3067\u304d\u308b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u3067\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u4eca\u56de\u306e\u3088\u3046\u306b\u5358\u4f53\u3067\u3082\u5c0e\u5165\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u25c7\u4f7f\u3044\u65b9<\/h2>\n<h3>\u25a0\u30b5\u30f3\u30d7\u30eb<\/h3>\n<p>\u5b9f\u969b\u306b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u4ee5\u4e0b\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>index.php<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\nrequire_once 'vendor\/autoload.php';\r\n$loader = new Twig_Loader_Filesystem('.\/view');\r\n$twig = new Twig_Environment($loader);\r\necho $twig-&gt;render('hello.html', array('name' =&gt; 'Twig'));\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Twig_Loader_Filesystem\u3067view\u306e\u4fdd\u5b58\u5148\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3057\u3066\u3044\u308b\u306e\u306f$twig-&gt;render()\u306e\u90e8\u5206\u3067\u3059\u3002name\u3068\u3044\u3046\u5909\u6570\u3067&#8217;Twig&#8217;\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>view\/hello.html<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\r\n&lt;h1&gt;Hello, {{name}}&lt;\/h1&gt;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u5b9f\u969b\u306e\u51fa\u529b\u753b\u9762<\/p>\n<p><a href=\"https:\/\/www.spiceworks.co.jp\/blog\/wp-content\/uploads\/2017\/04\/screencapture-localhost-twigSample-1493376410706.png\" data-rel=\"lightbox-gallery-STA4yQWo\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10384\" src=\"https:\/\/www.spiceworks.co.jp\/blog\/wp-content\/uploads\/2017\/04\/screencapture-localhost-twigSample-1493376410706.png\" alt=\"screencapture-localhost-twigsample-1493376410706\" width=\"270\" height=\"76\" \/><\/a><\/p>\n<p>\u3053\u308c\u3067\u3068\u308a\u3042\u3048\u305a\u7c21\u5358\u306b\u51fa\u529b\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002html\u5074\u3067\u5909\u6570\u3092\u51fa\u529b\u3057\u3066\u3042\u3052\u308b\u3068\u304d\u306f{{}}\u3067\u56f2\u3063\u3066\u3042\u3052\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u25a0\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/h3>\n<p>\u307e\u305a\u3001Twig\u306e\u69cb\u6587\u306b\u306f\u4e8c\u7a2e\u985e\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u51fa\u529b\u3092\u3059\u308b\uff1a{{ }}<\/p>\n<p>\u30ed\u30b8\u30c3\u30af\u51e6\u7406\u3092\u3059\u308b:{% %}<\/p>\n<p>&nbsp;<\/p>\n<p>\u751f\u306ePHP\u3060\u3068&lt;?php ?&gt;\u3068\u3044\u3046\u66f8\u304d\u65b9\u306b\u306a\u308b\u306e\u3067\u3001\u3053\u306e\u6642\u70b9\u3067\u5c11\u3057\u7c21\u7565\u5316\u3055\u308c\u3066\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u307b\u304b\u3001\u57fa\u672c\u7684\u306a\u69cb\u6587\u3092\u4ee5\u4e0b\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n{{name}} &lt;!--name\u3092\u51fa\u529b--&gt;\r\n\r\n\r\n{{arr.name}} &lt;!--\u914d\u5217\u3078\u306e\u30a2\u30af\u30bb\u30b9--&gt;\r\n\r\n\r\n{{arr.name}} &lt;!--\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u30a2\u30af\u30bb\u30b9--&gt;\r\n\r\n\r\n{% if name == 'takahashi' %} &lt;!--if\u6587--&gt;\r\ntrue\u306e\u6642\u306e\u51e6\u7406\r\n{% else %}\r\nfalse\u306e\u6642\u306e\u51e6\u7406\r\n{% endif %}\r\n\r\n\r\n{% for users in user %} &lt;!-- for\u6587 --&gt;\r\n{{ user.name }}\r\n{% endfor %}\r\n\r\n\r\n{{ 1 + 2 - 3 }} &lt;!-- \u56db\u5247\u6f14\u7b97 --&gt;\r\n\r\n\r\n{{ a and b or c }} &lt;!-- \u8ad6\u7406\u6f14\u7b97 --&gt;\r\n\r\n\r\n{% if not flag %} &lt;!-- \u5426\u5b9a\u6f14\u7b97\u5b50 --&gt;\r\n\r\n\r\n\u51fa\u529b\r\n\r\n{% endif %}\r\n\r\n\r\n{# \u30b3\u30e1\u30f3\u30c8\u6587 #} &lt;!-- \u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8 --&gt;\r\n\r\n\r\n{{ flag ? 'true' : 'false' }} &lt;!-- \u4e09\u9805\u6f14\u7b97\u5b50 --&gt;\r\n\r\n\r\n{{ '{{' }} name }} &lt;!-- \u30a8\u30b9\u30b1\u30fc\u30d7 --&gt;\r\n<\/pre>\n<p>\u3053\u306e\u4ed6\u306b\u3082\u30d5\u30a3\u30eb\u30bf\u30fc\u6a5f\u80fd\u304c\u3042\u308a\u3001\u5909\u6570\u540d|\u30d5\u30a3\u30eb\u30bf\u30fc\u540d\u3067\u69d8\u3005\u306a\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u5229\u7528\u3067\u304d\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u25a0\u8a73\u7d30\u306a\u4f7f\u3044\u65b9<\/p>\n<p>https:\/\/twig.sensiolabs.org\/doc\/2.x\/templates.html<\/p>\n<p>\u516c\u5f0f\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3067\u3059\u3002<\/p>\n<p>Twig\u306f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u7d99\u627f\u304c\u5f37\u307f\u3068\u3055\u308c\u3066\u3044\u3066\u3001\u305d\u306e\u5185\u5bb9\u306b\u3064\u3044\u3066\u3082\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u25c7\u307e\u3068\u3081<\/h2>\n<p>\u3068\u3044\u3046\u611f\u3058\u3067\u5165\u793e\u3057\u3066\u304b\u3089\u306fPHP\u3092\u89e6\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b\u30d6\u30ed\u30b0\u8a18\u4e8b\u3092\u66f8\u304f\u3068\u304d\u306fLaravel\u306b\u3064\u3044\u3066\u66f8\u3051\u305f\u3089\u3044\u3044\u306a\u3041\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u304a\u3057\u307e\u3044\uff01<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"&nbsp; \u521d\u3081\u307e\u3057\u3066\u3001\u30b9\u30d1\u30a4\u30b9\u30ef\u30fc\u30af\u30b9\u306e\u30a8\u30f3\u30b8\u30cb\u30a2\u3068\u3057\u30662016\u5e7410\u6708\u306b\u5165\u793e\u3057\u3066\u3044\u307e\u3057\u305f\u3001\u9ad9\u6a4b\u3067\u3059\u3002 \u521d\u3081\u3066\u3053\u3061\u3089\u306e\u30d6\u30ed\u30b0\u3092\u66f8\u304f\u306e\u3067\u3001\u6700\u521d\u306b\u81ea\u5df1\u7d39\u4ecb\u304b\u3089\u5165\u308a\u307e\u3059\u306d\u3002 \u25c7\u81ea\u5df1\u7d39\u4ecb \u3010\u540d\u524d\u3011\u9ad9\u6a4b \u3010\u597d\u304d\u306a\u3082\u306e\u3011\u30b2\u30fc\u30e0\u5168 [&hellip;]","protected":false},"author":33,"featured_media":10730,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[43,359,360,361,362,363,364],"class_list":["post-10359","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-website","tag-php","tag-twig","tag-360","tag-symfony","tag-laravel","tag-html","tag-smarty"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PHP\u3067Smarty\u306e\u4ee3\u308f\u308a\u306bTwig\u3092\u4f7f\u3063\u3066\u307f\u305f - spiceworks Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP\u3067Smarty\u306e\u4ee3\u308f\u308a\u306bTwig\u3092\u4f7f\u3063\u3066\u307f\u305f - spiceworks Blog\" \/>\n<meta property=\"og:description\" content=\"&nbsp; \u521d\u3081\u307e\u3057\u3066\u3001\u30b9\u30d1\u30a4\u30b9\u30ef\u30fc\u30af\u30b9\u306e\u30a8\u30f3\u30b8\u30cb\u30a2\u3068\u3057\u30662016\u5e7410\u6708\u306b\u5165\u793e\u3057\u3066\u3044\u307e\u3057\u305f\u3001\u9ad9\u6a4b\u3067\u3059\u3002 \u521d\u3081\u3066\u3053\u3061\u3089\u306e\u30d6\u30ed\u30b0\u3092\u66f8\u304f\u306e\u3067\u3001\u6700\u521d\u306b\u81ea\u5df1\u7d39\u4ecb\u304b\u3089\u5165\u308a\u307e\u3059\u306d\u3002 \u25c7\u81ea\u5df1\u7d39\u4ecb \u3010\u540d\u524d\u3011\u9ad9\u6a4b \u3010\u597d\u304d\u306a\u3082\u306e\u3011\u30b2\u30fc\u30e0\u5168 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359\" \/>\n<meta property=\"og:site_name\" content=\"spiceworks Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-08-09T10:48:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-20T09:09:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.spiceworks.co.jp\/blog\/wp-content\/uploads\/2017\/06\/a11b4bb3ba448d1fa402ac3dc62cc91f1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u9ad9\u6a4b \u5149\u592b\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u9ad9\u6a4b \u5149\u592b\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?p=10359#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?p=10359\"},\"author\":{\"name\":\"\u9ad9\u6a4b \u5149\u592b\",\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/#\\\/schema\\\/person\\\/887bd7de387910ba5f5b59261b904ba6\"},\"headline\":\"PHP\u3067Smarty\u306e\u4ee3\u308f\u308a\u306bTwig\u3092\u4f7f\u3063\u3066\u307f\u305f\",\"datePublished\":\"2017-08-09T10:48:26+00:00\",\"dateModified\":\"2024-05-20T09:09:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?p=10359\"},\"wordCount\":349,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?p=10359#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/a11b4bb3ba448d1fa402ac3dc62cc91f1.jpg\",\"keywords\":[\"PHP\",\"Twig\",\"\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\",\"Symfony\",\"Laravel\",\"html\",\"Smarty\"],\"articleSection\":[\"Web\u5236\u4f5c\u30fb\u30b7\u30b9\u30c6\u30e0\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?p=10359#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?p=10359\",\"url\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?p=10359\",\"name\":\"PHP\u3067Smarty\u306e\u4ee3\u308f\u308a\u306bTwig\u3092\u4f7f\u3063\u3066\u307f\u305f - spiceworks Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?p=10359#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?p=10359#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/a11b4bb3ba448d1fa402ac3dc62cc91f1.jpg\",\"datePublished\":\"2017-08-09T10:48:26+00:00\",\"dateModified\":\"2024-05-20T09:09:13+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/#\\\/schema\\\/person\\\/887bd7de387910ba5f5b59261b904ba6\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?p=10359#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?p=10359\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?p=10359#primaryimage\",\"url\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/a11b4bb3ba448d1fa402ac3dc62cc91f1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/a11b4bb3ba448d1fa402ac3dc62cc91f1.jpg\",\"width\":500,\"height\":500},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?p=10359#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP\u3067Smarty\u306e\u4ee3\u308f\u308a\u306bTwig\u3092\u4f7f\u3063\u3066\u307f\u305f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/\",\"name\":\"spiceworks Blog\",\"description\":\"&quot;\u4f1d\u308f\u308b&quot;\u3092\u30c7\u30b6\u30a4\u30f3\u3059\u308b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/#\\\/schema\\\/person\\\/887bd7de387910ba5f5b59261b904ba6\",\"name\":\"\u9ad9\u6a4b \u5149\u592b\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/71eabd49ba0bc8dbc190dae16a5b7ef5b306acd97085e1339569023e3a78a7a3?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/71eabd49ba0bc8dbc190dae16a5b7ef5b306acd97085e1339569023e3a78a7a3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/71eabd49ba0bc8dbc190dae16a5b7ef5b306acd97085e1339569023e3a78a7a3?s=96&d=mm&r=g\",\"caption\":\"\u9ad9\u6a4b \u5149\u592b\"},\"url\":\"https:\\\/\\\/www.spiceworks.co.jp\\\/blog\\\/?author=33\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHP\u3067Smarty\u306e\u4ee3\u308f\u308a\u306bTwig\u3092\u4f7f\u3063\u3066\u307f\u305f - spiceworks Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359","og_locale":"ja_JP","og_type":"article","og_title":"PHP\u3067Smarty\u306e\u4ee3\u308f\u308a\u306bTwig\u3092\u4f7f\u3063\u3066\u307f\u305f - spiceworks Blog","og_description":"&nbsp; \u521d\u3081\u307e\u3057\u3066\u3001\u30b9\u30d1\u30a4\u30b9\u30ef\u30fc\u30af\u30b9\u306e\u30a8\u30f3\u30b8\u30cb\u30a2\u3068\u3057\u30662016\u5e7410\u6708\u306b\u5165\u793e\u3057\u3066\u3044\u307e\u3057\u305f\u3001\u9ad9\u6a4b\u3067\u3059\u3002 \u521d\u3081\u3066\u3053\u3061\u3089\u306e\u30d6\u30ed\u30b0\u3092\u66f8\u304f\u306e\u3067\u3001\u6700\u521d\u306b\u81ea\u5df1\u7d39\u4ecb\u304b\u3089\u5165\u308a\u307e\u3059\u306d\u3002 \u25c7\u81ea\u5df1\u7d39\u4ecb \u3010\u540d\u524d\u3011\u9ad9\u6a4b \u3010\u597d\u304d\u306a\u3082\u306e\u3011\u30b2\u30fc\u30e0\u5168 [&hellip;]","og_url":"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359","og_site_name":"spiceworks Blog","article_published_time":"2017-08-09T10:48:26+00:00","article_modified_time":"2024-05-20T09:09:13+00:00","og_image":[{"width":500,"height":500,"url":"https:\/\/www.spiceworks.co.jp\/blog\/wp-content\/uploads\/2017\/06\/a11b4bb3ba448d1fa402ac3dc62cc91f1.jpg","type":"image\/jpeg"}],"author":"\u9ad9\u6a4b \u5149\u592b","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u9ad9\u6a4b \u5149\u592b","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"2\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359#article","isPartOf":{"@id":"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359"},"author":{"name":"\u9ad9\u6a4b \u5149\u592b","@id":"https:\/\/www.spiceworks.co.jp\/blog\/#\/schema\/person\/887bd7de387910ba5f5b59261b904ba6"},"headline":"PHP\u3067Smarty\u306e\u4ee3\u308f\u308a\u306bTwig\u3092\u4f7f\u3063\u3066\u307f\u305f","datePublished":"2017-08-09T10:48:26+00:00","dateModified":"2024-05-20T09:09:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359"},"wordCount":349,"commentCount":0,"image":{"@id":"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359#primaryimage"},"thumbnailUrl":"https:\/\/www.spiceworks.co.jp\/blog\/wp-content\/uploads\/2017\/06\/a11b4bb3ba448d1fa402ac3dc62cc91f1.jpg","keywords":["PHP","Twig","\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3","Symfony","Laravel","html","Smarty"],"articleSection":["Web\u5236\u4f5c\u30fb\u30b7\u30b9\u30c6\u30e0"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.spiceworks.co.jp\/blog\/?p=10359#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359","url":"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359","name":"PHP\u3067Smarty\u306e\u4ee3\u308f\u308a\u306bTwig\u3092\u4f7f\u3063\u3066\u307f\u305f - spiceworks Blog","isPartOf":{"@id":"https:\/\/www.spiceworks.co.jp\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359#primaryimage"},"image":{"@id":"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359#primaryimage"},"thumbnailUrl":"https:\/\/www.spiceworks.co.jp\/blog\/wp-content\/uploads\/2017\/06\/a11b4bb3ba448d1fa402ac3dc62cc91f1.jpg","datePublished":"2017-08-09T10:48:26+00:00","dateModified":"2024-05-20T09:09:13+00:00","author":{"@id":"https:\/\/www.spiceworks.co.jp\/blog\/#\/schema\/person\/887bd7de387910ba5f5b59261b904ba6"},"breadcrumb":{"@id":"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.spiceworks.co.jp\/blog\/?p=10359"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359#primaryimage","url":"https:\/\/www.spiceworks.co.jp\/blog\/wp-content\/uploads\/2017\/06\/a11b4bb3ba448d1fa402ac3dc62cc91f1.jpg","contentUrl":"https:\/\/www.spiceworks.co.jp\/blog\/wp-content\/uploads\/2017\/06\/a11b4bb3ba448d1fa402ac3dc62cc91f1.jpg","width":500,"height":500},{"@type":"BreadcrumbList","@id":"https:\/\/www.spiceworks.co.jp\/blog\/?p=10359#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.spiceworks.co.jp\/blog"},{"@type":"ListItem","position":2,"name":"PHP\u3067Smarty\u306e\u4ee3\u308f\u308a\u306bTwig\u3092\u4f7f\u3063\u3066\u307f\u305f"}]},{"@type":"WebSite","@id":"https:\/\/www.spiceworks.co.jp\/blog\/#website","url":"https:\/\/www.spiceworks.co.jp\/blog\/","name":"spiceworks Blog","description":"&quot;\u4f1d\u308f\u308b&quot;\u3092\u30c7\u30b6\u30a4\u30f3\u3059\u308b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.spiceworks.co.jp\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.spiceworks.co.jp\/blog\/#\/schema\/person\/887bd7de387910ba5f5b59261b904ba6","name":"\u9ad9\u6a4b \u5149\u592b","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/71eabd49ba0bc8dbc190dae16a5b7ef5b306acd97085e1339569023e3a78a7a3?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/71eabd49ba0bc8dbc190dae16a5b7ef5b306acd97085e1339569023e3a78a7a3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/71eabd49ba0bc8dbc190dae16a5b7ef5b306acd97085e1339569023e3a78a7a3?s=96&d=mm&r=g","caption":"\u9ad9\u6a4b \u5149\u592b"},"url":"https:\/\/www.spiceworks.co.jp\/blog\/?author=33"}]}},"_links":{"self":[{"href":"https:\/\/www.spiceworks.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.spiceworks.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spiceworks.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spiceworks.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spiceworks.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10359"}],"version-history":[{"count":30,"href":"https:\/\/www.spiceworks.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10359\/revisions"}],"predecessor-version":[{"id":11151,"href":"https:\/\/www.spiceworks.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10359\/revisions\/11151"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.spiceworks.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/media\/10730"}],"wp:attachment":[{"href":"https:\/\/www.spiceworks.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spiceworks.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spiceworks.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}