0
不顯示我在CakePHP的三種型號CakePHP的鏈接模型中的hasMany
//Union
public $hasMany = 'Member';
和
//Member
public $hasOne = 'Post';
,其中作爲後包含交名字
現在的問題是,當我使用:
$this->Union->findById(1);
在聯盟控制器它顯示鏈接的成員,但不是帖子的名稱
[Union] => Array
(
[id] => 1
[Name] => Dawa vyapar mandal
[created] => 2014-03-31 14:08:12
)
[Member] => Array
(
[0] => Array
(
[id] => 1
[Name] => Ashish
[post_id] => 1
[union_id] => 1
[created] => 2014-03-31 14:11:02
)
[1] => Array
(
[id] => 2
[Name] => Ashu
[post_id] => 1
[union_id] => 1
[created] => 2014-07-01 15:01:15
)
)
)
那麼如何實現郵政模型內成員模型?
使用這樣的函數:$ this->聯盟 - >遞歸= 2; $這 - >聯盟 - > findById(1); – Garry