Site error problem

Unable to resolve the request "site/error". (/Applications/MAMP/htdocs/yii/framework/web/CWebApplication.php:328)

I keep getting the above error.

In my config as the default it has put the error handler as "site/error". Also I have an "error" file in "views/site/error"

Why am I getting this error? Also I am too interested in programming the errors just yet, I do not really even need the "site/error" file at all hopefully. Almost just trying to get basic "Hello World" working.

CHttpException

Unable to resolve the request "site/error". (/Applications/MAMP/htdocs/yii/framework/web/CWebApplication.php:328)

#0 /Applications/MAMP/htdocs/yii/framework/base/CErrorHandler.php(236): CWebApplication->runController(‘site/error’)

#1 /Applications/MAMP/htdocs/yii/framework/base/CErrorHandler.php(154): CErrorHandler->render(‘error’, Array)

#2 /Applications/MAMP/htdocs/yii/framework/base/CErrorHandler.php(96): CErrorHandler->handleException(Object(CHttpException))

#3 /Applications/MAMP/htdocs/yii/framework/base/CApplication.php(611): CErrorHandler->handle(Object(CExceptionEvent))

#4 [internal function]: CApplication->handleException(Object(CHttpException))

#5 {main}

Do you have action "error" in your "site" controller?

No, I do not even have a site controller.

I will create one now.

I have …

User, Company models.

Account controller

And thats it.

I am assuming there must be an error then otherwise it would not be trying to execute "site/error"?

Ok now I have created the "site" controller with "error" action: -

<?php

class Site extends CController {


	


	public function error() {


		


		


		


	}


	


}

?>

Still getting the same error.

You need to write such code:




class SiteController extends CController

{

  public function actionError()

  {

  }

}



Ahh its ok now, I did not relise there where naming conventions.

i.e. SiteController, compared to Site

Also I did not release that controller methods needed "action" before them.

Shame on you. :)

Read the docs:

http://www.yiiframework.com/doc/guide/1.1/en/basics.convention

Maybe read this if you’re new to MVC:

http://www.larryullman.com/2009/10/08/understanding-mvc/

But, whatever you do, read the documentation.

Otherwise you’re wasting both your own time and our time. ;)

Cheers for the response.

Just another quick question, do the database table column names have to be in camel case? As they as represented by a variable / property when writing the code?

Lower case, with word separating underscore.

Preferably singular names.

Like:


user_profile