$this->loadModel('Section');
$this->Section->getNav();

On May 18, 4:45 pm, "[email protected]" <[email protected]>
wrote:
> In most projects I find I need to reference one model in every context
> say for example 'sections' which holds the top level navigation,
> usually I place a function in the app_controller that gets the
> navigation details and adds them to the view, whats the best way to
> access the model ?
>
> Currently I'm using;
>    $this->{$this->modelClass}->Section->getNav();
>
> which is messy, or
>
> $section = ClassRegistry::init('Section');
> $section->getNav();
>
> a bit better, but what is the 'proper' way to do it?
>
> chris
>
> 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

Reply via email to