I found my issue. What I meant was I was trying to get the 'username' to 
show up in a view that is not a view from the actual plugin.

My mistake was simple, In my hasmany model relationship, I didn't have 
correct 'className', just had the controller name 'User' but was missing 
the reference to the plugin. 

Incorrectly had this:
    public $belongsTo = array(
        'User' => array(
            'className' => 'User',
            'foreignKey' => 'user_id',
            'conditions' => '',
            'fields' => '',
            'order' => ''
        )
Needed this:
    public $belongsTo = array(
        'User' => array(
            'className' => 'Users.User',
            'foreignKey' => 'user_id',
            'conditions' => '',
            'fields' => '',
            'order' => ''
        )

Thanks again for your help.

On Thursday, January 3, 2013 8:58:34 PM UTC-6, cricket wrote:
>
> Not sure what you mean by that. Have you tried debug($data) to see 
> what's in the array? 
>
> On Thu, Jan 3, 2013 at 7:22 PM, mk <[email protected] <javascript:>> 
> wrote: 
> > Thanks for quick reply. I will take another look at the plugin views, 
> but I 
> > am not sure that is where I need to change things. 
> > 
> > I'm calling the user_id hoping to get the displayField from outside of 
> the 
> > plugin from a view from my main app. 
> > 
> > 
> > 
> > On Thursday, January 3, 2013 5:22:34 PM UTC-6, cricket wrote: 
> >> 
> >> On Thu, Jan 3, 2013 at 5:14 PM, mk <[email protected]> wrote: 
> >> > Hi, 
> >> > 
> >> > I'm using the CakeDC Users plugin and have it working, however when I 
> >> > access 
> >> > it from a View in the main app, it is showing only the user id rather 
> >> > than 
> >> > the displayfield = 
> >> > 'username'; 
> >> > 
> >> > Plugin User Model contains 
> >> >     public $displayField = 'username'; 
> >> 
> >> Does your users table have a 'username' column? 
> >> 
> >> > Main App View (add.ctp) Contains 
> >> >     echo $this->Form->input('user_id'); 
> >> 
> >> That looks a little odd. I would expect that the id would be 
> >> auto-generated and that, minimally, there would be a username input. 
> >> 
> >> I haven't used this plugin, btw. 
> >> 
> >> ok, I've just looked at the schema for this. The user_id column is in 
> >> the user_details table. It's the foreign key pointing to the users 
> >> table. 
> >> 
> >> Take a look at the views that come with the plugin. I think that 
> >> perhaps you've tried modifying things and taken a wrong turn 
> >> somewhere. 
> >> 
> >> > View displays user_id rather than username. 
> >> > 
> >> > Any ideas on what needs to be done to get this to show displayfield 
> >> > correctly? I tried adding a recursive=2 to the add action for the 
> >> > correspoiding view but that did not work... 
> >> 
> >> Changing recursive would have no effect. 
> > 
> > -- 
> > Like Us on FaceBook https://www.facebook.com/CakePHP 
> > Find us on Twitter http://twitter.com/CakePHP 
> > 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "CakePHP" group. 
> > To post to this group, send email to [email protected]<javascript:>. 
>
> > To unsubscribe from this group, send email to 
> > [email protected] <javascript:>. 
> > Visit this group at http://groups.google.com/group/cake-php?hl=en. 
> > 
> > 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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].
Visit this group at http://groups.google.com/group/cake-php?hl=en.


Reply via email to