$categ = $this->FreeadsCategory->bindModel( array( 'hasMany' => array( 'Subcategory' => array('foreignKey' => 'category_id', 'order'=>'id ASC') ) ) );
$data = $this->FreeadsCategory->findById($i); $this->set("datas", $data);
- I am not able to fetch the datas in view page using cakephp
- If i give pr($datas); showing nothing in ctp file
- If i print the data in controller i am getting the following array structure
Array ( [FreeadsCategory] => Array ( [id] => 1 [uuid] => 51512434-e4c4-441b-b90e-16f8732d5573 [category] => Automobiles [status] => Active )
[Subcategory] => Array
(
[0] => Array
(
[id] => 1
[uuid] => 4ea15f22-adf0-4020-b35d1-052ff9ff9a27
[category_id] => 1
[subcategory] => Cars/Cabs/Jeeps
[status] => Active
)
[1] => Array
(
[id] => 5
[uuid] => 51cec363-e7ac-4095-a86b-0ccdf260d1b4
[category_id] => 1
[subcategory] => Buses/Lorries
[status] => Active
)
)