This is the add.ctp file that's producing the error

```
<?php
echo $form->create('Category');
echo $form->input('name');
echo $form->end('Save Post');
?>

```

This is the CategoriesController.php file associated with add.ctp

```
<?php

class CategoriesController extends AppController {

    var $name = 'Categories';

    function index() {
        $this->set('categories', $this->Category->find('all'));
    }

    function add() {
        if (!empty($this->data)) {
            if ($this->Category->save($this->data)) {
                $this->Session->setFlash('Your category has been saved.');
                $this->redirect(array('action' => 'index'));
            }
        }
    }
}

?>

```

I keep receiving the following error message:

> 
> `Call to a member function create() on a non-object`
> 
> 
>