0
我在CakePHP的模型:CakePHP的從表中獲取數據類belongs_to的
class PagesTable extends Table
{
public function initialize(array $config)
{
$this->addBehavior('Timestamp');
$this->belongsTo('Pagecats');
$this->belongsToMany('Users');
}
和另一種模式PagecatsTable:
class PagecatsTable extends Table
{
public function initialize(array $config)
{
$this->addBehavior('Timestamp');
}
它的表有兩個coloumns id
和category
如何在我的PagesController中的函數中獲得category
?
'Pagecats'有一個'類別'coloumn。我想要它的價值,爲我目前的頁面 –