Really Confused here. I keep getting an undefined index.
controller:
function makemodel($id = null) {
$this->Make->id = $id;
$makes = $this->Make->find('all', array(
'conditions' => array('id' => $id),
'contain' => array('Makemodel' => array('Road'))
)
);
$this->set(compact('makes'));
}
view:
im echoing. which coming from the array that should be correct $makes[‘Make’][‘MakeName’]
I also tried $makes[‘Make’][0][‘MakeName’]
it states its having an issue at [‘Make’]
array:
Array
(
[0] => Array
(
[Make] => Array
(
[id] => 2
[url_make] => ford
[MakeName] => Ford
[MakeOrigin] => USA
[Summary] =>
)
[Makemodel] => Array
(
[0] => Array
(
[id] => 2
[ModelName] => Focus
[make_id] => 2
[Road] => Array
(
[0] => Array
(
[id] => 1
[makemodel_id] => 2
[RoadTypeID] => 1
[name] => Dirt
)
[1] => Array
(
[id] => 2
[makemodel_id] => 2
[RoadTypeID] => 2
[name] => Snow
)
)
)
)
)
)
Looking at the array it’d be:
$makes[0][‘Make’][‘id’] etc.