{"id":721,"date":"2011-02-22T12:22:12","date_gmt":"2011-02-22T03:22:12","guid":{"rendered":"http:\/\/www.lancard.com\/blog\/?p=721"},"modified":"2025-03-12T11:31:17","modified_gmt":"2025-03-12T02:31:17","slug":"cakephp-%e3%81%a7%e3%82%b7%e3%82%a7%e3%83%ab%e3%82%92%e6%9b%b8%e3%81%8f%e3%81%a8%e3%81%8d%e3%81%ab%e6%9c%80%e5%88%9d%e3%81%ab%e3%82%84%e3%81%a3%e3%81%9f%e3%81%93%e3%81%a8%e8%a6%aa%e3%82%af%e3%83%a9","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2011\/02\/22\/cakephp-%e3%81%a7%e3%82%b7%e3%82%a7%e3%83%ab%e3%82%92%e6%9b%b8%e3%81%8f%e3%81%a8%e3%81%8d%e3%81%ab%e6%9c%80%e5%88%9d%e3%81%ab%e3%82%84%e3%81%a3%e3%81%9f%e3%81%93%e3%81%a8%e8%a6%aa%e3%82%af%e3%83%a9\/","title":{"rendered":"CakePHP \u3067\u30b7\u30a7\u30eb\u3092\u66f8\u304f\u3068\u304d\u306b\u6700\u521d\u306b\u3084\u3063\u305f\u3053\u3068(\u89aa\u30af\u30e9\u30b9\u4f5c\u308a)"},"content":{"rendered":"<p>CakePHP \u306b\u306f\u30c7\u30d0\u30c3\u30b0\u3067\u4fbf\u5229\u306a pr() \u3063\u3066\u95a2\u6570\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u51fa\u529b\u306e\u524d\u5f8c\u306b pre \u30bf\u30b0 \u3092\u4ed8\u3051\u3066\u304f\u308c\u308b print_r() \u306e\u30e9\u30c3\u30d1\u30fc\u3067\u3059\u3002\u5f53\u7136Web\u7528\u3002<\/p>\n<p>\u30b7\u30a7\u30eb\u306b\u3082\u6b32\u3057\u3044\u3067\u3059\u3002\u3066\u306a\u308f\u3051\u3067\u4f5c\u308a\u307e\u3057\u305f\u3002<\/p>\n<pre lang=\"Php\" line=\"1\">\n    function pr($obj){\n        $pr = print_r($obj, true);\n        $this->out($pr);\n    }\n<\/pre>\n<p>\u7c21\u5358\u3002\u3053\u3093\u306a\u611f\u3058\u3067\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre lang=\"Php\" line=\"1\">\n    $popopopooon = array(&#039;\u3053\u3093\u306b\u3061\u308f&#039; => &#039;\u3053\u3093\u306b\u3061\u30ef\u30f3&#039;, &#039;\u3042\u308a\u304c\u3068\u3046&#039; => &#039;\u3042\u308a\u304c\u3068\u30a6\u30b5\u30ae&#039;);\n    $this->pr($popopopooon);\n<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre lang=\"Bash\" line=\"1\">\n Array\n(\n    [\u3053\u3093\u306b\u3061\u308f] => \u3053\u3093\u306b\u3061\u30ef\u30f3\n    [\u3042\u308a\u304c\u3068\u3046] => \u3042\u308a\u304c\u3068\u30a6\u30b5\u30ae\n)\n<\/pre>\n<p>print_r() \u306f\u7b2c\uff12\u5f15\u6570\u306b true \u3092\u6e21\u3059\u3068\u51fa\u529b\u305b\u305a\u306b\u7d50\u679c\u3092\u8fd4\u3057\u3066\u304f\u308c\u308b\u306e\u3067\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u69cb\u9020\u3092\u30ed\u30b0\u306b\u51fa\u3057\u305f\u308a\u3059\u308b\u3068\u304d\u306b\u3082\u4fbf\u5229\u3067\u3059\u3002<br \/>\n\u00a0<br \/>\n\u3067\u3082\u30b3\u30ec\u3001\u5168\u90e8\u306e\u30b7\u30a7\u30eb\u306b\u66f8\u304d\u305f\u304f\u306a\u3044\u3002<\/p>\n<p>\u3069\u3053\u306b\u96c6\u7d04\u3057\u305f\u3089\u3044\u3044\u306e\u304b\u60a9\u3093\u3060\u306e\u3067\u3059\u304c\u3001\u5b9f\u969b\u306b\u5b9f\u884c\u3059\u308b\u30b7\u30a7\u30eb\u306e\u89aa\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u3066\u7d99\u627f\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002\u7d99\u627f\u306e\u6bb5\u6570\u304c\u5897\u3048\u308b\u306e\u306f\u3042\u307e\u308a\u3059\u304d\u3058\u3083\u306a\u3044\u306e\u3067\u3059\u304c\u3001Shell\u30af\u30e9\u30b9 \u3092\u305d\u306e\u307e\u307e\u7d99\u627f\u3059\u308b\u3088\u308a\u3082\uff11\u6bb5\u5897\u3084\u3057\u3068\u3044\u305f\u307b\u3046\u304c\u3044\u3044\u304b\u306a\uff1f\u3063\u3066\u6c17\u3082\u3057\u305f\u306e\u3067\u3002<\/p>\n<p>appbase.php<\/p>\n<pre lang=\"Php\" line=\"1\">\nclass AppbaseShell extends Shell {\n\n    function initialize() {\n        parent::initialize();\n    }\n\n    function startup() {\n        \/\/\u30a6\u30a7\u30eb\u30ab\u30e0\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6d88\u3059\u305f\u3081\u306b\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\n    }\n\n    \/**\n     * \u30c7\u30d0\u30c3\u30b0\u7528\n     *\/\n    protected function pr($obj){\n        $pr = print_r($obj, true);\n        $this->out($pr);\n    }\n}\n<\/pre>\n<p>\u3064\u3044\u3067\u306b startup() \u3092\u30aa\u30fc\u30d0\u30e9\u30a4\u30c9\u3057\u3066\u30a6\u30a7\u30eb\u30ab\u30e0\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6d88\u3057\u307e\u3057\u305f\u3002<br \/>\n\u3053\u3046\u3044\u3046\u4e8b\u3084\u308b\u306b\u306f\uff11\u6bb5\u3042\u3044\u3060\u306b\u5165\u3063\u3066\u308b\u307b\u3046\u304c\u3044\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u8d77\u52d5\u3059\u308b\u30b7\u30a7\u30eb\u306f AppbaseShell\u30af\u30e9\u30b9 \u3092\u7d99\u627f\u3057\u307e\u3059\u3002<\/p>\n<p>aisatu.php<\/p>\n<pre lang=\"Php\" line=\"1\">\nApp::import(&#039;Shell&#039;, &#039;Appbase&#039;);\nclass AisatuShell extends AppbaseShell {\n    function initialize() {\n        parent::initialize();\n    }\n\n    function main() {\n        $popopopooon = array(&#039;\u3053\u3093\u306b\u3061\u308f&#039; => &#039;\u3053\u3093\u306b\u3061\u30ef\u30f3&#039;, &#039;\u3042\u308a\u304c\u3068\u3046&#039; => &#039;\u3042\u308a\u304c\u3068\u30a6\u30b5\u30ae&#039;);\n        $this->pr($popopopooon);\n    }\n}\n<\/pre>\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u4eca\u30c6\u30ad\u30c8\u30fc\u306b\u66f8\u3044\u305f\u306e\u3067\u3061\u3087\u3063\u3068\u3042\u3084\u3057\u3044\u304b\u3082\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u30aa\u30c1\u3092\u3002<\/p>\n<p>\u3053\u306epr\u30e1\u30bd\u30c3\u30c9\u3001\u5b9f\u969b\u306b\u4f5c\u3063\u305f\u3093\u3067\u3059\u304c\u666e\u901a\u306b print_r() \u3059\u308c\u3070\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u51fa\u529b\u3055\u308c\u308b\u3093\u3067\u3059\u3088\u306d\u30fc\u3002\u300c\u305d\u308a\u3083\u305d\u3046\u3060\u300d\u3068\u5f8c\u3067\u6c17\u3065\u3044\u305f\u308f\u3051\u3067\u3002<\/p>\n<p>CakePHP \u306e\u30b7\u30a7\u30eb\u3067\u306f $this->out() \u3067\u30b3\u30f3\u30bd\u30fc\u30eb\u3078\u306e\u51fa\u529b\u3092\u3059\u308b\u3053\u3068\u306b\u306a\u3063\u3066\u307e\u3059\u304c\u3001\u958b\u767a\u4e2d\u306b\u3057\u304b\u4f7f\u308f\u306a\u3044\u3057 print_r() \u3092\u305d\u306e\u307e\u307e\u4f7f\u3048\u3070\u3044\u3044\u304b\u306a\u3068\u3002\u89aa\u30af\u30e9\u30b9\u306f\u6a5f\u80fd\u306e\u96c6\u7d04\u306b\u5f79\u7acb\u3063\u3066\u307e\u3059\u3002<\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F721&#038;t=CakePHP%20%E3%81%A7%E3%82%B7%E3%82%A7%E3%83%AB%E3%82%92%E6%9B%B8%E3%81%8F%E3%81%A8%E3%81%8D%E3%81%AB%E6%9C%80%E5%88%9D%E3%81%AB%E3%82%84%E3%81%A3%E3%81%9F%E3%81%93%E3%81%A8%28%E8%A6%AA%E3%82%AF%E3%83%A9%E3%82%B9%E4%BD%9C%E3%82%8A%29&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F721&#038;p&#091;images&#093;&#091;0&#093;=&#038;p&#091;title&#093;=CakePHP%20%E3%81%A7%E3%82%B7%E3%82%A7%E3%83%AB%E3%82%92%E6%9B%B8%E3%81%8F%E3%81%A8%E3%81%8D%E3%81%AB%E6%9C%80%E5%88%9D%E3%81%AB%E3%82%84%E3%81%A3%E3%81%9F%E3%81%93%E3%81%A8%28%E8%A6%AA%E3%82%AF%E3%83%A9%E3%82%B9%E4%BD%9C%E3%82%8A%29\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F721&#038;text=CakePHP%20%E3%81%A7%E3%82%B7%E3%82%A7%E3%83%AB%E3%82%92%E6%9B%B8%E3%81%8F%E3%81%A8%E3%81%8D%E3%81%AB%E6%9C%80%E5%88%9D%E3%81%AB%E3%82%84%E3%81%A3%E3%81%9F%E3%81%93%E3%81%A8%28%E8%A6%AA%E3%82%AF%E3%83%A9%E3%82%B9%E4%BD%9C%E3%82%8A%29\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F721&#038;title=CakePHP%20%E3%81%A7%E3%82%B7%E3%82%A7%E3%83%AB%E3%82%92%E6%9B%B8%E3%81%8F%E3%81%A8%E3%81%8D%E3%81%AB%E6%9C%80%E5%88%9D%E3%81%AB%E3%82%84%E3%81%A3%E3%81%9F%E3%81%93%E3%81%A8%28%E8%A6%AA%E3%82%AF%E3%83%A9%E3%82%B9%E4%BD%9C%E3%82%8A%29\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&#038;v=3&#038;t=CakePHP%20%E3%81%A7%E3%82%B7%E3%82%A7%E3%83%AB%E3%82%92%E6%9B%B8%E3%81%8F%E3%81%A8%E3%81%8D%E3%81%AB%E6%9C%80%E5%88%9D%E3%81%AB%E3%82%84%E3%81%A3%E3%81%9F%E3%81%93%E3%81%A8%28%E8%A6%AA%E3%82%AF%E3%83%A9%E3%82%B9%E4%BD%9C%E3%82%8A%29&#038;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F721\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=CakePHP%20%E3%81%A7%E3%82%B7%E3%82%A7%E3%83%AB%E3%82%92%E6%9B%B8%E3%81%8F%E3%81%A8%E3%81%8D%E3%81%AB%E6%9C%80%E5%88%9D%E3%81%AB%E3%82%84%E3%81%A3%E3%81%9F%E3%81%93%E3%81%A8%28%E8%A6%AA%E3%82%AF%E3%83%A9%E3%82%B9%E4%BD%9C%E3%82%8A%29&#038;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F721\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>CakePHP \u306b\u306f\u30c7\u30d0\u30c3\u30b0\u3067\u4fbf\u5229\u306a pr() \u3063\u3066\u95a2\u6570\u304c\u3042\u308a\u307e\u3059\u3002 \u51fa\u529b\u306e\u524d\u5f8c\u306b pre \u30bf\u30b0 \u3092\u4ed8\u3051\u3066\u304f\u308c\u308b print_r() \u306e\u30e9\u30c3\u30d1\u30fc\u3067\u3059\u3002\u5f53\u7136Web\u7528\u3002 \u30b7\u30a7\u30eb\u306b\u3082\u6b32\u3057\u3044\u3067\u3059\u3002\u3066\u306a\u308f\u3051\u3067\u4f5c\u308a\u307e\u3057\u305f\u3002 func [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[24],"class_list":["post-721","post","type-post","status-publish","format-standard","hentry","category-1","tag-cakephp"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=721"}],"version-history":[{"count":18,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/721\/revisions"}],"predecessor-version":[{"id":4794,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/721\/revisions\/4794"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}