{"id":847,"date":"2014-02-25T16:00:57","date_gmt":"2014-02-25T07:00:57","guid":{"rendered":"http:\/\/www.beeete2.com\/blog\/?p=847"},"modified":"2018-02-21T22:24:39","modified_gmt":"2018-02-21T13:24:39","slug":"post-847","status":"publish","type":"post","link":"https:\/\/www.beeete2.com\/blog\/?p=847","title":{"rendered":"CakePHP\u3067\u72ec\u81ea\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u7d99\u627f\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>CakePHP\u3067\u72ec\u81ea\u306b\u4f5c\u3063\u305f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u7d99\u627f\u3059\u308b\u65b9\u6cd5\u3092\u8abf\u3079\u307e\u3057\u305f\u3002<br \/>\n\u81ea\u5206\u306fJava\u3092\u3088\u304f\u4f7f\u3063\u3066\u3044\u305f\u3068\u3044\u3046\u306e\u306f\u5909\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u7d99\u627f\u3068\u3044\u3046\u306e\u306f\u305d\u308c\u307b\u3069\u9055\u548c\u611f\u306f\u306a\u3044\u306e\u3067\u3059\u304cCakePHP\u306a\u3069\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u7d99\u627f\u3059\u308b\u306e\u306f\u3054\u6cd5\u5ea6\u306a\u306e\u3067\u3059\u304b\u306d\u3002\u305d\u306e\u8fba\u308a\u306f\u3042\u3093\u307e\u308a\u8a73\u3057\u304f\u306a\u3044\u306e\u3067\u3001\u3042\u304f\u307e\u3067\u72ec\u81ea\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u7d99\u627f\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<br \/>\n<!--more--><\/p>\n<h4>\u7d99\u627f\u3057\u305f\u3044\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u4f5c\u6210<\/h4>\n<p>app\/Controller\/BaseController.php\u3068\u3057\u3066\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002<br \/>\n[php]<br \/>\n&lt;?php<br \/>\nclass BaseController extends AppController {<br \/>\n\tfunction namae() {<br \/>\n\t\treturn &quot;\u79c1\u306fBaseController\u3067\u3059\u3002&quot;;<br \/>\n\t}<br \/>\n}<br \/>\n[\/php]<br \/>\n\u52d5\u4f5c\u78ba\u8a8d\u3088\u3046\u306bnamae\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3092\u7528\u610f\u3057\u307e\u3057\u305f\u3002<\/p>\n<h4>BaseController\u3092\u7d99\u627f\u3057\u305f<\/h4>\n<p>\u306a\u3093\u3067\u3082\u3044\u3044\u306e\u3067\u3059\u304c\u3001HelloController\u3068\u3044\u3046\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u304c\u3042\u308b\u3068\u3057\u3066\u3053\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067BaseController\u3092\u7d99\u627f\u3057\u307e\u3059\u3002<br \/>\n\u305d\u306e\u6642\u306b\u91cd\u8981\u306a\u306e\u306f\u7d99\u627f\u3057\u305f\u3044\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4e88\u3081\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u3059\u3002<br \/>\n\u307e\u305findex\u30e1\u30bd\u30c3\u30c9\u3067parent::namae\u3068\u3057\u3066\u89aa\u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066debug\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u753b\u9762\u306b\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n[php]<br \/>\nApp::uses(&#8216;BaseController&#8217;, &#8216;Controller&#8217;);<br \/>\nclass HelloController extends BaseController {<br \/>\n\tpublic function index() {<br \/>\n\t\tdebug(parent::namae());<br \/>\n\t}<br \/>\n}<br \/>\n[\/php]<\/p>\n<h4>\u5b9f\u884c\u3057\u3066\u307f\u308b<\/h4>\n<p>\u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001<br \/>\n<a href=\"https:\/\/www.beeete2.com\/blog\/wp-content\/uploads\/2014\/02\/debug1.png\"><img decoding=\"async\" src=\"https:\/\/www.beeete2.com\/blog\/wp-content\/uploads\/2014\/02\/debug1.png\" alt=\"debug1\" width=\"809\" height=\"459\" class=\"alignnone size-full wp-image-848\" srcset=\"https:\/\/www.beeete2.com\/blog\/wp-content\/uploads\/2014\/02\/debug1.png 809w, https:\/\/www.beeete2.com\/blog\/wp-content\/uploads\/2014\/02\/debug1-300x170.png 300w\" sizes=\"(max-width: 809px) 100vw, 809px\" \/><\/a><br \/>\n\u306e\u3088\u3046\u306b\u9ec4\u8272\u3044\u90e8\u5206\u306b\u89aa\u30af\u30e9\u30b9\u3067\u5b9a\u7fa9\u3057\u305fnamae\u30e1\u30bd\u30c3\u30c9\u306e\u5185\u5bb9\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<h4>\u7d50\u3073\u306b<\/h4>\n<p>\u4eca\u56de\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u3057\u305f\u304c\u3001\u540c\u3058\u8981\u9818\u3067\u30d3\u30e5\u30fc\u306a\u3069\u5404\u7a2e\u30af\u30e9\u30b9\u3092\u5229\u7528\u3067\u304d\u305d\u3046\u3067\u3059\u3002<br \/>\n\u306fCakePHP\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u8aad\u3080\u3068\u5229\u7528\u4f8b\u304c\u66f8\u3044\u3066\u3042\u308a\u307e\u3059\u306e\u3067\u53c2\u7167\u3059\u308b\u3068\u4fbf\u5229\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/book.cakephp.org\/2.0\/ja\/core-utility-libraries\/app.html\" target=\"_blank\">App \u30af\u30e9\u30b9 &mdash; CakePHP Cookbook 2.x \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CakePHP\u3067\u72ec\u81ea\u306b\u4f5c\u3063\u305f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u7d99\u627f\u3059\u308b\u65b9\u6cd5\u3092\u8abf\u3079\u307e\u3057\u305f\u3002 \u81ea\u5206\u306fJava\u3092\u3088\u304f\u4f7f\u3063\u3066\u3044\u305f\u3068\u3044\u3046\u306e\u306f\u5909\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u7d99\u627f\u3068\u3044\u3046\u306e\u306f\u305d\u308c\u307b\u3069\u9055\u548c\u611f\u306f\u306a\u3044\u306e\u3067\u3059\u304cCakePH &#8230; <\/p>\n","protected":false},"author":1,"featured_media":839,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"views":17448,"_links":{"self":[{"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/847"}],"collection":[{"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=847"}],"version-history":[{"count":3,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/847\/revisions"}],"predecessor-version":[{"id":1742,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/847\/revisions\/1742"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/839"}],"wp:attachment":[{"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}