问题
how to try like this, i already write in ItemsTable.php like this
public function initialize(array $config) {
$this->belongsTo('Categories', [
'className' => 'Item',
'foreignKey' => 'cid',
'propertyName' => 'name'
]);
}
How do I display category name instead of Cid
?
来源:https://stackoverflow.com/questions/27718675/how-to-find-field-through-foreign-key-in-cakephp3-x-x