Hi,
I created a Controller called battles_controller.php and a model
called battle.php.
There is a function in the model called GetStats. I tried to call this
function with:
$this->Battle->GetStats(); I got error:

Notice (8): Undefined property:  BattlesController::$Battle [APP/
controllers/battles_controller.php, line 12]
Code

        if(!$this->Session->check('battle'))
        {
            $Character    = $this->Battle->GetStats();

BattlesController::beforeFilter() - APP/controllers/
battles_controller.php, line 12
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 186
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 170
[main] - APP/webroot/index.php, line 83


Fatal error: Call to a member function GetStats() on a non-object in
***/app/controllers/battles_controller.php on line 12


Have I done something wrong or why is there this error?

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to