我们如何从两个或多个表中获取 cakephp 中的层次结构数据
How we can fetch data in hierarchy in cakephp from two or more tables
这里我确实有问题我的 table 我已经研究了食谱但仍然没有找到合适的答案因为我是初学者我也搜索了 Stack overflow 但仍然有问题
我读过这个 from CookBoook 2X 但没有得到最终答案
我确实有一个问题,我有两个 table,一个与另一个
居住
parent table=> Countries
Child table=> State
Grand Child=> City
我想简单地从 citiesController 获取国家数据
我用
$this->City->find('all');
但它只获取与城市和州相关的数据
男孩用这个
$this->City->recursive=2;
$Cities= $this->City->find('all');
使用这个递归属性,Cake 将知道在 find() 和 read() 方法时需要生成的结果的深度
这里我确实有问题我的 table 我已经研究了食谱但仍然没有找到合适的答案因为我是初学者我也搜索了 Stack overflow 但仍然有问题 我读过这个 from CookBoook 2X 但没有得到最终答案 我确实有一个问题,我有两个 table,一个与另一个
居住parent table=> Countries
Child table=> State
Grand Child=> City
我想简单地从 citiesController 获取国家数据 我用
$this->City->find('all');
但它只获取与城市和州相关的数据
男孩用这个
$this->City->recursive=2;
$Cities= $this->City->find('all');
使用这个递归属性,Cake 将知道在 find() 和 read() 方法时需要生成的结果的深度