It also looks like in at least your sample code you were sending
$Practicioner to the view and trying to loop over $Practicioners
(notice one is plural - one is singular)

On Jul 21, 10:46 am, mthabisi mlunjwa <[email protected]> wrote:
> Thanks Jeremy!
>
> I used $practitioner['Practice'][0]['town'] and its now working.
> Thanks a lot man!
>
> On Jul 21, 4:17 pm, Jeremy Burns | Class Outfit
>
>
>
>
>
>
>
> <[email protected]> wrote:
> > I apologise;
>
> > $practitioner['Practice'][0]['town']
>
> > Not sure how you are generating that array...
>
> > Jeremy Burns
> > Class Outfit
>
> >http://www.classoutfit.com
>
> > On 21 Jul 2011, at 15:14, Jeremy Burns | Class Outfit wrote:
>
> > > So (assuming this array is called $practitioner) you can display the town 
> > > by $practitioner['Practice']['town'].
>
> > > Jeremy Burns
> > > Class Outfit
>
> > >http://www.classoutfit.com
>
> > > On 21 Jul 2011, at 15:02, mthabisi mlunjwa wrote:
>
> > >> Sorry its a typo. All field names are in lower case.
>
> > >> I'm failing to display the town. But when I use debug($Practitioner)
> > >> the practitioner fields and practice towns are all displayed as shown
> > >> below:
> > >> array
> > >> (
> > >>    [0] => Array
> > >>        (
> > >>            [Practitioner] => Array
> > >>                (
> > >>                    [id] => 233
> > >>                    [region_id] => 2
> > >>                    [country_id] => 5
> > >>                    [status_id] => 1
> > >>                    [role_id] => 2
> > >>                    [bsrno] => 241
> > >>                    [surname] => Bossley
> > >>                    [name] => Bronwyn
> > >>                    [cell] => 0215656765
> > >>                    [password] =>
> > >> dd4e8d1e0dfeb4ace2dda0fdfc8db83948109151
> > >>                    [created] => 0000-00-00 00:00:00
> > >>                    [modified] => 2011-05-05 11:11:45
> > >>                )
>
> > >>            [Practice] => Array
> > >>                (
> > >>                    [0] => Array
> > >>                        (
> > >>                            [id] => 233
> > >>                            [practitioner_id] => 233
> > >>                            [region_id] => 2
> > >>                            [country_id] => 5
> > >>                            [name] => Main
> > >>                            [Telephone] => +61 411673912
> > >>                            [Address] => 15 Edna Street, Carrimundi,
> > >> Queensland, 4551, Australia
> > >>                            [town] => Carrimundi
> > >>                        )
>
> > >>                )
>
> > >>        )
>
> > >> From my own understanding I thought the containable behaviour helps to
> > >> filter out unwanted results so as to improve the overall response
> > >> time. At the moment I'm interested in displaying the practise town.
>
> > >> On Jul 21, 3:13 pm, Jeremy Burns | Class Outfit
> > >> <[email protected]> wrote:
> > >>> Not sure if it's a typo, but your field names should be lower case.
>
> > >>> Look at the Containable behaviour 
> > >>> (http://book.cakephp.org/view/1323/Containable).
>
> > >>> Jeremy Burns
> > >>> Class Outfit
>
> > >>>http://www.classoutfit.com
>
> > >>> On 21 Jul 2011, at 14:10, mthabisi mlunjwa wrote:
>
> > >>>> I have two models: Practitioner and Practice
>
> > >>>> Practitioner hasMany Practice and
> > >>>> Practise Belongs to Practitioner
>
> > >>>> The practise model has the following fields id,Practitioner_id, Name,
> > >>>> Town etc.
> > >>>> The Practitioner model has the following fields id,Surname, Name, Cell
> > >>>> etc.
>
> > >>>> In my controller I used a find function:
> > >>>>    $Practitioner = $this->Practitioner->find('all');
> > >>>>        $this->set(compact('Practitioner'));
>
> > >>>> In my view I want to display the practitioner name, Surname, cell,
> > >>>> practice name and practice town.
>
> > >>>> I can display practitioner name, Surname and cell using code like this
> > >>>> $Practitioners['Practitioner']['cell']
> > >>>> But I'm failing to display  the corresponding practitioner's practice
> > >>>> name and practice town. I've tried using: $Practitioners['Practice']
> > >>>> ['town'];  to display town but it looks like nothing gets displayed.
>
> > >>>> How can I display town? Please help thanks in advance
>
> > >>>> --
> > >>>> Our newest site for the community: CakePHP Video 
> > >>>> Tutorialshttp://tv.cakephp.org
> > >>>> Check out the new CakePHP Questions 
> > >>>> sitehttp://ask.cakephp.organdhelpothers with their CakePHP related 
> > >>>> questions.
>
> > >>>> To unsubscribe from this group, send email to
> > >>>> [email protected] For more options, visit this 
> > >>>> group athttp://groups.google.com/group/cake-php
>
> > >> --
> > >> Our newest site for the community: CakePHP Video 
> > >> Tutorialshttp://tv.cakephp.org
> > >> Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
> > >> others with their CakePHP related questions.
>
> > >> To unsubscribe from this group, send email to
> > >> [email protected] For more options, visit this group 
> > >> athttp://groups.google.com/group/cake-php
>
> > > --
> > > Our newest site for the community: CakePHP Video 
> > > Tutorialshttp://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
> > > others with their CakePHP related questions.
>
> > > To unsubscribe from this group, send email to
> > > [email protected] For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to