why this simple cakephp app not working

syedasimmeesaq
syedasimmeesaq used Ask the Experts™
on
I am trying out cakephp and I have database configured. I have three tables in database,
posts
users
comments

In models folder I have 2 files, post.php and user.php
post.php has this
<?php
class Post extends AppModel {

            var $name='Post';
            var $blenogsTo = array('User');
}
?>

user.php has this
<?php

class User extends AppModel {

      var $name = 'User';
      var $hasMany = array('Post');
      
}
?>

then under controllers folder I have 2 files, posts_controller.php and users_controller.php
in posts_controller.php I have this
<?php

class PostsController extends AppController {
                  var $name = 'Posts';
                  var $scoffold;
}
?>

in users_controller.php I have this
<?php

class UsersController extends AppController {
                  var $name = 'Users';
                  
                  var $scoffold;
                  
}
?>



Now all I am doing is scoffolding and when I go to localhost/cake/users
it gives me this error

Missing Method in UsersController
Error: The action index is not defined in controller UsersController

Error: Create UsersController::index() in file: app\controllers\users_controller.php.

<?php
class UsersController extends AppController {

      var $name = 'Users';


      function index() {

      }

}
?>
Notice: If you want to customize this error message, create app\views\errors\missing_action.ctp.


any help will be appreciated.
Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You need to be using the User model.

Make sure this is in your controller: $uses = array('User');

Author

Commented:
which file?
what do u mean $uses?
thanks
aaaaaaaah
figured it out myself

it was misspeeling
scaffold was spelled scoffold.

thanks for trying!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial