CakePHP Hash::combine() でキーと値の組み合わせがずれる

CakePHP 2.2以降で利用できるHashクラスのcombineメソッドには以下の罠があります。 Code: < ?php $data = [ [ 'id' => 1, 'title' => 'first title', 'body' => 'first content' ], [ 'id' => 3, 'title' => 'second title', 'body' => 'second content', 'more' => 'second more content' ], [ 'id' => 5, 'title' => 'third title', 'body' => 'third content', 'more' => 'third more content' ], ]; $results = Hash::combine($data, '{n}.id', '{n}.more'); この場合、$resultsは以下の値になることを期待するでしょう。 ...

12月 18, 2013 · nojimage

CakePHP 2.2のHash::extract()はCentOS5/RHEL5系では使えない

先日CakePHPのバグレポートをしたのでご報告。 #3821 Hash::extract() not working on CentOS 5 - CakePHP - cakephp ※この話はCakePHP2.2 - 2.3.4までが該当します。次バージョン(2.3.5)以降は修正が適用されるため大丈夫です。 ...

5月 10, 2013 · nojimage