{"id":5598,"date":"2014-11-20T03:02:58","date_gmt":"2014-11-19T18:02:58","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=5598"},"modified":"2014-11-20T03:09:28","modified_gmt":"2014-11-19T18:09:28","slug":"laravel4%e3%81%a7%e3%82%82smarty%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%81%84%ef%bc%81","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=5598","title":{"rendered":"Laravel4\u3067\u3082Smarty\u3092\u4f7f\u7528\u3057\u305f\u3044\uff01"},"content":{"rendered":"<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/LL1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/LL1.png\" alt=\"\" title=\"LL\" width=\"380\" height=\"55\" class=\"alignnone size-full wp-image-5601\" \/><\/a><\/p>\n<p>\u3069\u3082\u3067\u3059\u3002<\/p>\n<p>Laravel4\u3067\u3082Smarty\u3092\u4f7f\u7528\u3057\u305f\u3044\u4f7f\u7528\u3057\u305f\u3044\u4f7f\u7528&#8230;.\u3002\u3002\u3002<\/p>\n<p>\u305d\u3046\u3002Laravel\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u00a0blade\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304c\u5099\u308f\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u5225\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u304c\u4f7f\u3044\u305f\u3044\u3002<\/p>\n<p>\u3068\u3044\u3063\u305f\u308f\u304c\u307e\u307e\u3092\u8a00\u3063\u3066\u898b\u305f\u3044\u6642\u671f\u3060\u3063\u305f\u308a\u3082\u3059\u308b\u8a33\u3067\u3059\u3088\u3002<\/p>\n<p>\u4f7f\u3044\u6163\u308c\u305f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u304c\u826f\u304b\u3063\u305f\u308a\u3057\u307e\u3059\u3088\u306d\u30fc\u3002<\/p>\n<p>\u3067\u304d\u308b\u306e\u304b\u306a\u30fc\u3002\u3068\u601d\u3063\u3066\u3044\u305f\u3089\u3001<\/p>\n<p>.<\/p>\n<p>..<\/p>\n<p>..<\/p>\n<p>\u3067\u304d\u307e\u3059\u306d\u30fc\uff01\uff01 \uff1e\uff1c<\/p>\n<p>\u3053\u3061\u3089\u3068\u304b<\/p>\n<p><a href=\"http:\/\/packalyst.com\/packages\/package\/comnect\/smarty\" target=\"_blank\">http:\/\/packalyst.com\/packages\/package\/comnect\/smarty<\/a><\/p>\n<p><a href=\"http:\/\/blog.comnect.jp.net\/blog\/76\" target=\"_blank\">http:\/\/blog.comnect.jp.net\/blog\/76<\/a><\/p>\n<p>\u3053\u3061\u3089\u3092\u53c2\u8003\u3067\u3059\u3002<\/p>\n<h4>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<h3>for Laravel4.2<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\"require\": {\r\n    \"comnect\/smarty\": \"2.*\"\r\n},<\/pre>\n<h3>for Laravel4.1<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\"require\": {\r\n    \"comnect\/smarty\": \"1.*\"\r\n},<\/pre>\n<p>\u3068\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u5fa1\u4f7f\u3044\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u5408\u308f\u305bcomposer.json\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\"require\": { \r\n    \"laravel\/framework\": \"4.1.*\",\r\n    \"comnect\/smarty\": \"1.0\" \r\n},<\/pre>\n<p>\u305d\u3057\u3066\u3001Laravel\u306eapp\/config\/app.php\u306eproviders\u306b\u4ee5\u4e0b\u3092\u8ffd\u52a0\u3057\u3066<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">'Comnect\\Smarty\\SmartyServiceProvider'<\/pre>\n<p>\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067composer update\u3092\u5165\u529b\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">composer update<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001artisan\u30b3\u30de\u30f3\u30c9\u3067\u30b3\u30f3\u30d5\u30a3\u30b0\u3092\u30d1\u30d6\u30ea\u30c3\u30b7\u30e5\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">php artisan config:publish comnect\/smarty<\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u3068 app\/conig\/packages\u306e\u4e0b\u306bcomnect\/smarty\/config.php \u3068\u3044\u3063\u305f\u3001smarty\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u3068\u540c\u69d8\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&lt;?php\r\n\/\/ smarty configure\r\nreturn &#x5B;\r\n    \/\/ smarty file extension\r\n    'extension' =&gt; 'tpl',\r\n    \/\/\r\n    'debugging' =&gt; false,\r\n    \/\/ use cache\r\n    'caching' =&gt; false,\r\n    \/\/\r\n    'cache_lifetime' =&gt; 120,\r\n    \/\/\r\n    'compile_check' =&gt; false,\r\n    \/\/ delimiters\r\n    \/\/ default &quot;{$smarty}&quot;\r\n    'left_delimiter' =&gt; '{',\r\n    'right_delimiter' =&gt; '}',\r\n    \/\/ path info\r\n    'template_path' =&gt; app_path() . '\/views',\r\n    'cache_path' =&gt; app_path() . '\/storage\/smarty\/cache',\r\n    'compile_path' =&gt; app_path() . '\/storage\/smarty\/compile',\r\n    'plugins_paths' =&gt; &#x5B;\r\n    app_path() . '\/views\/smarty\/plugins',\r\n    ]\r\n];<\/pre>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306fapp\/storage\u306e\u4e0b\u306bcache\u3068compile\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u306e\u3067\u3001app\/storage\u306b\u5fc5\u305a\u5b9f\u884c\u6a29\u9650\u3092\u4e0e\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3072\u3068\u307e\u305a\u3053\u308c\u3067\u4f7f\u7528\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<h4>\u4f7f\u7528\u65b9\u6cd5<\/h4>\n<p>\u7279\u306b\u5909\u66f4\u3057\u306a\u304f\u3066\u3082\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">return View::make('home');<\/pre>\n<p>views\u914d\u4e0b\u306bsmarty\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308c\u3070\u305d\u308c\u3092\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3068\u4f7f\u7528\u3057\u3001\u306a\u3051\u308c\u3070\u901a\u5e38\u901a\u308ablade\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304bphp\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001blade\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3082\u305d\u306e\u307e\u307e\u4f75\u7528\u3082\u53ef\u80fd\u3068\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002\u512a\u79c0\uff01<\/p>\n<p>smarty\u306e\u30e1\u30bd\u30c3\u30c9\u3082\u5229\u7528\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>use smarty method<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">View::assign('word', 'hello');<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">View::clearAllAssign();<\/pre>\n<p>\u5024\u3082\u4e00\u7dd2\u306b\u6e21\u3057\u305f\u3044\u5834\u5408<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">return View::make('template', &#x5B;'values' =&gt;\u00a0$values]);<\/pre>\n<p>with\u3067\u3082\u540c\u3058\u3067\u3059<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">return View::make('template')-&gt;with('values',\u00a0$values);<\/pre>\n<h4>Artisan<\/h4>\n<p>artisan\u30b3\u30de\u30f3\u30c9\u3067\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30af\u30ea\u30a2\u3057\u305f\u3044\u5834\u5408\u306f<\/p>\n<h5>cache clear<\/h5>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">php artisan comnect:smarty-cacheclear<\/pre>\n<p><strong>Options<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">--file (-f) specify file<\/pre>\n<p>\u00a0<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">--time (-t) clear all of the files that are specified duration time<\/pre>\n<p>&#8211;file (-f) specify file:\uff1a\u524a\u9664\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a<\/p>\n<p>&#8211;time (-t) clear all of the files that are specified duration time:\uff1acache\u306e\u7d4c\u904e\u6642\u9593\u3092\u6307\u5b9a\u3057\u3066\u524a\u9664<\/p>\n<h5>remove compile class<\/h5>\n<p>\u307e\u305f\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u30d5\u30a1\u30a4\u30eb\u306e\u524a\u9664\u3082\u884c\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">php artisan comnect:smarty-clear-compiled<\/pre>\n<p><strong>Options<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">--file (-f) specify file<\/pre>\n<p>&#8211;file (-f) specify file\uff1a\u524a\u9664\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a<\/p>\n<p>\u305d\u306e\u4ed6\u3001smarty modifier, sumarty function\u306a\u3069\u3059\u3079\u3066\u4f7f\u7528\u53ef\u80fd\u3068\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u914d\u5217\u3067\u8a18\u8ff0\u3059\u308b\u5834\u5408\u306f\u30b7\u30e7\u30fc\u30c8\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u306e\u307f\u5bfe\u5fdc\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u3044\u3084\u30fc\u52a9\u304b\u308a\u307e\u3059\u306d\u30fc\u3002\u3088\u308d\u3057\u3051\u308c\u3070\u30fc\u3002\u3067\u306f\u3067\u306f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3069\u3082\u3067\u3059\u3002 Laravel4\u3067\u3082Smarty\u3092\u4f7f\u7528\u3057\u305f\u3044\u4f7f\u7528\u3057\u305f\u3044\u4f7f\u7528&#8230;.\u3002\u3002\u3002 \u305d\u3046\u3002Laravel\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u00a0blade\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304c\u5099\u308f\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u5225\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u304c\u4f7f\u3044\u305f\u3044\u3002 \u3068\u3044\u3063 [&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":[107,180,173,150,44,45,78],"class_list":{"0":"post-5598","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-php","7":"tag-mamp","8":"tag-mysql","9":"tag-php","10":"tag-vagrant","11":"tag-web","13":"tag-78"},"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/5598","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=5598"}],"version-history":[{"count":9,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/5598\/revisions"}],"predecessor-version":[{"id":5607,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/5598\/revisions\/5607"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}