Quantcast
Channel: まとめーたー
Viewing all articles
Browse latest Browse all 454

cakephp 2.x アソシエーション で usedbconfig

$
0
0
photoBy: http://www.shellbarbakery.com/wp-content/uploads/… usedbconfigが効かない!? $hasAndBelongsToMany や belongsto をしている場合、命名規則が間違っているとアソシエーションが効かずにエラーになる。 しかし、どこが悪いのかわからない。。。 そんな時のデバッグ方法。 /lib/cake/model/model.php の 718行目に以下の構文を入れる pr($this); $this->useDbConfig = 'twipper'; これで今どのモデルが使われているかがわかるのでデバッグしやすい。

Viewing all articles
Browse latest Browse all 454

Trending Articles