1

Hi I am an absolute beginner for cakephp. I have created a controller tasks_controller.php and the class name is TasksController according to cake naming conventions as tasks is my table name in the database.I have put index action in this controller but i run this in browser, I get this error,

Missing Controller

Error: TasksController could not be found.

Error: Create the class TasksController below in file: app\Controller\TasksController.php

}

My url is : localhost/cakephp/tasks/index

I am quite new so don't know how to fix this problem. I am using cakephp 2.4.0.

Please help me in this.

7
  • tasksController or TasksController? respect the casing. Commented Sep 14, 2013 at 11:39
  • TasksController is my controller name and file name is tasks_controller.php. Is something wrong in my naming conventions ?? Commented Sep 14, 2013 at 11:42
  • can you please explain whats wrong with my code. Thanks Commented Sep 14, 2013 at 11:46
  • Where did you find that it should be "tasks_controller.php"? Please post the link. The documentation sure does not. Commented Sep 14, 2013 at 11:51
  • I followed this tutorial just for understanding of cakephp. I did what they have said in this tutorials, Please visit this link to confirm where is the actual mistake . packtpub.com/article/… Commented Sep 14, 2013 at 12:00

1 Answer 1

3

Create the class TasksController below in file: app\Controller\TasksController.php

You have called your file tasks_controller.php. Read the error carefully ;-)

The naming convention for controller files was updated in cakephp 2.0. Looks like you are using the old 1.x conventions

Sign up to request clarification or add additional context in comments.

3 Comments

Sometimes I wonder how an error message could possibility be any more descriptive as it already is.. :)
@mark, Please have a look this link. packtpub.com/article/…
@cowls your are right, it was due to the old naming conventions, i have used. now i changed it and it works well now. Thanks i accepted your answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.