Dave Maharaj :: WidePixels.com wrote:
> I have a states table which holds id, abrev, name
>  
> My user profile displays the State.name based on the id. (HABTM table)
>  
> <?php echo $user['User']['state_id']; ?> displays California
>  
> How can i get it to display CA rather than the full name?
>  
> the controller gets the user info by:
> $this->set('users', $this->paginate());
>  
> Thanks,
>  
> Dave


Why HABTM?

Shouldn't it be sth like: User hasOne State, State belongsTo User? It 
should be enough to just have a state_id at your user table.


Marcel


--~--~---------~--~----~------------~-------~--~----~
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