Hi,
Suppose I a users table, a groups table, and every user belongs to a
group. I'd like via the app_controller to get the group's name, in
order to set it in the view.
I've used the following code in app_controller.php:
function beforeRender(){
        $this->loadModel('Group');
        $group = $this->Group->find('id = ' . $this->Auth->user('group_id'));
        $this->set('groupName', $group['Group']['name']);
}

This code works great, but is there another way than using the
loadModel method? thanks.

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