in my app_controller,php i set my menu like this:

        function beforeFilter ()
        {
                // Make admin menu available and use admin layout
                if (isset($this->params['admin'])) {
                        // Set menu
                        $this->set 
('admin_menu',$this->AdminMenu->findAllThreaded(null,
null, 'sort_id'));
                        // Use admin layout
                        $this->layout = 'admin_layout';
                } else {
                        // Set menu
                        $this->set 
('main_menu',$this->Menu->findAllThreaded(null, null,
'sort_id'));
                        // Use admin layout
                        $this->layout = 'default';
                }

        }


Only when i go to an action which does no exists yet i get this
error :
Notice (8): Undefined property:  AppController::$Menu [CORE\app
\app_controller.php, line 20]


            $this->layout = 'admin_layout';



        } else {



            // Set menu



            $this->set ('main_menu',$this->Menu->findAllThreaded(null,
null, 'sort_id'));



            // Use admin layout

AppController::beforeFilter() - CORE\app\app_controller.php, line 20
Dispatcher::start() - CORE\cake\dispatcher.php, line 380
ErrorHandler::__construct() - CORE\cake\libs\error.php, line 81
Object::cakeError() - CORE\cake\libs\object.php, line 176
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 307
[main] - CORE\app\webroot\index.php, line 83


Fatal error: Call to a member function findAllThreaded() on a non-
object in C:\wamp\www\mech7\app\app_controller.php on line 20

Does anybody know gow to solve this ?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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