Excellent, Smithers.

Jeremy Burns
[email protected]


On 16 Apr 2010, at 10:20, mivogt-LU wrote:

> HI Mr Burns (sorry could not resist, just like the simpson now and
> then..) ;)
> 
> thanks I got it working.
> The lesson I learnd:
> 
> 1) if any data of a related model is used/shown in a view it is
> accessable
> 2) there is no need to prepare this in the controller if it is only
> needed to be displays in a view
> 3) inside a view it is a question of using the right array index
> 
> In my case I tried to access the array $customers using the Index
> ['phone'] wich was a fault.
> I got (using debug $customers in the view instead of the controller)
> that all data is still available inside the view.
> Inside the view with right handling of the $customers array I got all
> I need.
> $MyCustomerPhoneNumer = $customers['customer']['phone'];
> works fine.
> 
> So anybody later then me looking up this thread: MIND THE INDEX of the
> damned arrays 1st and 2nd dimensions.
> 
> 
> Thanks again.
> 
> Michael
> 
> cake 1.3RCx
> 
> On 16 Apr., 10:49, Jeremy Burns <[email protected]> wrote:
>> Have a read of this thread...might help.
>> 
>> http://groups.google.com/group/cake-php/browse_thread/thread/e01fd12a...
>> 
>> Jeremy Burns
>> [email protected]
>> (Skype) +44 208 123 3822 (jeremy_burns)
>> (m) +44 7973 481949
>> (h) +44 208 530 7573
>> 
>> On 16 Apr 2010, at 09:44, mivogt-LU wrote:
>> 
>> 
>> 
>>> I also tried adding var $uses = array('customer','request');  in the
>>> bookings controller.
>>> If I do so I get an error inside my find commands:
>> 
>>> if ($rid)  {       $customers = $this->Booking->Customer-
>>>> find('list',array('conditions' => array('Customer.id' => $cid)));          
>>>>       }
>>>                    else    {       $customers = 
>>> $this->Booking->Customer->find('list');
>> 
>>> $rid is the request id passed from request index list to the add
>>> function of bookings
>>> $cid is the customer id passed from request index list to the add
>>> function of bookings
>> 
>>> error:
>>> Notice (8): Undefined property: BookingsController::$Booking [APP
>>> \controllers\bookings_controller.php, line 31]
>>> Code | Context
>> 
>>>        }
>> 
>>>        if ($rid)     {    $customers = $this->Booking->Customer-
>>>> find('list',array('conditions' => array('Customer.id' =>
>>> $cid)));        }
>> 
>>> $rid       =       "15"
>>> $cid       =       "12"
>>> $nid       =       "R-1271-3641-04"
>> 
>>> BookingsController::add() - APP\controllers\bookings_controller.php,
>>> line 31
>>> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 202
>>> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 170
>>> [main] - APP\webroot\index.php, line 83
>> 
>>> Notice (8): Trying to get property of non-object [APP\controllers
>>> \bookings_controller.php, line 31]
>> 
>>> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
>>> with their CakePHP related questions.
>> 
>>> You received this message because you are subscribed to the Google Groups 
>>> "CakePHP" group.
>>> To post to this group, send email to [email protected]
>>> To unsubscribe from this group, send email to
>>> [email protected] For more options, visit this group 
>>> athttp://groups.google.com/group/cake-php?hl=en
>> 
>> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
>> with their CakePHP related questions.
>> 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected] For more options, visit this group 
>> athttp://groups.google.com/group/cake-php?hl=en
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to