{"id":368,"date":"2024-04-18T10:34:22","date_gmt":"2024-04-18T01:34:22","guid":{"rendered":"https:\/\/txn.myds.me\/blog\/?p=368"},"modified":"2024-04-18T10:34:22","modified_gmt":"2024-04-18T01:34:22","slug":"cakephp5-%e3%81%ae%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab%e3%81%a7%e3%83%8f%e3%83%9e%e3%81%a3%e3%81%9f%e3%82%89%e8%8b%b1%e8%aa%9e%e7%89%88%e3%82%92","status":"publish","type":"post","link":"https:\/\/blog.txn.red\/?p=368","title":{"rendered":"CakePHP5 \u306e\u65e5\u672c\u8a9e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u30cf\u30de\u3063\u305f\u3089\u82f1\u8a9e\u7248\u3092\u898b\u3088\u3046\uff01"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u8ffd\u8a18: \u30d7\u30eb\u30ea\u30af\u304c\u53d6\u308a\u8fbc\u307e\u308c\u305f\u306e\u3067\u3053\u306e\u30da\u30fc\u30b8\u306e\u5185\u5bb9\u306f\u672c\u5bb6\u898b\u308c\u3070 OK \u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f15\u7d9a\u304d\u3001CakePHP\uff15 \u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u9032\u884c\u3057\u3066\u307e\u3059\u304c\u3001\u3069\u3046\u3082\u30b3\u30fc\u30c9\u30b5\u30f3\u30d7\u30eb\u304c\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u3082\u306e\u306e\u3088\u3046\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u5c11\u3057\u30cf\u30de\u308a\u307e\u3057\u305f\u3002\u307e\u3042\u3001\u82f1\u8a9e\u7248\u898b\u308d\u3088\u3068\u3002\u3002\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5177\u4f53\u7684\u306b\u306f <a href=\"https:\/\/book.cakephp.org\/5\/ja\/tutorials-and-examples\/cms\/articles-controller.html\">CMS \u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb &#8211; Articles \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u4f5c\u6210 &#8211; 5.x<\/a> \u306e ArticleController \u306e paginator \u90e8\u5206\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/book.cakephp.org\/5\/en\/tutorials-and-examples\/cms\/articles-controller.html\">\u82f1\u8a9e\u7248<\/a> \u3092\u898b\u3066\u307f\u308b\u3068\u30b3\u30fc\u30c9\u304c\u9055\u3063\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>&lt;?php\n\/\/ src\/Controller\/ArticlesController.php\n\nnamespace App\\Controller;\n\nclass ArticlesController extends AppController\n{\n    public function index()\n    {\n        $articles = $this-&gt;paginate($this-&gt;Articles);\n        $this-&gt;set(compact(&#39;articles&#39;));\n    }\n}<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">paginate \u306f\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u306f\u306a\u304f\u3066\u305d\u3082\u305d\u3082\u7d44\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002\u65e5\u672c\u8a9e\u7248\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u30d7\u30eb\u30ea\u30af\u3060\u3057\u307e\u3057\u305f\u304c\u3001\u82f1\u8a9e\u529b\u304c\u602a\u3057\u3059\u304e\u308b\u306e\u3067\u8e74\u3089\u308c\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u308f\u308a\u3068\u3061\u3083\u3093\u3068\u7ffb\u8a33\u3055\u308c\u3066\u305d\u3046\u306a\u96f0\u56f2\u6c17\u3060\u3063\u305f\u306e\u3067\u76f2\u4fe1\u3057\u3066\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u9032\u3081\u3066\u304d\u305f\u306e\u3067\u3059\u304c\u3001\u601d\u308f\u306c\u843d\u3068\u3057\u7a74\u306b\u7a81\u304d\u5f53\u305f\u308a\u307e\u3057\u305f\u3002\u305b\u3081\u3066\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u30da\u30fc\u30b8\u3060\u3051\u3067\u3082\u3061\u3083\u3093\u3068\u6574\u5099\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u307e\u3059\u307e\u3059 CakePHP \u306e\u4e0d\u4eba\u6c17\u306b\u62cd\u8eca\u304c\u304b\u304b\u308a\u305d\u3046\u3060\u306a\u3068\u611f\u3058\u305f\u4e00\u5e55\u3067\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8ffd\u8a18: \u30d7\u30eb\u30ea\u30af\u304c\u53d6\u308a\u8fbc\u307e\u308c\u305f\u306e\u3067\u3053\u306e\u30da\u30fc\u30b8\u306e\u5185\u5bb9\u306f\u672c\u5bb6\u898b\u308c\u3070 OK \u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u5f15\u7d9a\u304d\u3001CakePHP\uff15 \u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u9032\u884c\u3057\u3066\u307e\u3059\u304c\u3001\u3069\u3046\u3082\u30b3\u30fc\u30c9\u30b5\u30f3\u30d7\u30eb\u304c\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u3082\u306e\u306e\u3088\u3046\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u5c11\u3057\u30cf\u30de\u308a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1,"footnotes":""},"categories":[9],"tags":[15],"class_list":["post-368","post","type-post","status-publish","format-standard","hentry","category-dev","tag-cakephp"],"_links":{"self":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts\/368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=368"}],"version-history":[{"count":0,"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts\/368\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}