tags:

views:

372

answers:

2

I am trying out cakePHP so I have a very simple site. I get the following error.

class Tag extends AppModel { $name = 'Tag'; } Fatal error: Class 'Tag' not found in /home/downtown/public_html/test_cake/cake/libs/class_registry.php on line 140

in ..\app\models\tag.php I have

class Tag extends AppModel { $name = 'Tag'; }

What silly blunder am I making? I have tried clearing tmp/cache and I have reloaded cakePHP from scratch. I have seen this error in Google searches but it was a relatively obvious syntax error.

The cakephp answer system is not sending me a confirmation email so I have to ask this question here.

A: 

It might be, that "tag" is a reserved word in CakePHP, try to use another class name, and report if you get this error again.

My recommendation:

  • cakephp on google groups

Suggestion:

Use:

var $name = 'Tag';

instead of

$name = 'Tag';
daemonfire300
I get the same error on another model with the class name "Note".
Jim Rootham
Did you tryed my suggestion? Use something more abstract, and in fully lowercase, e.g. 'pencil'
daemonfire300
Just to clear that up, I did create a table called pencils and a class called Pencil and got the same error. The leading upper case char is a requirement of the cakePHP naming conventions.Also cakephp on Google croups is closed.
Jim Rootham
I can send you an invitation, I never recognized CakePHP on google groups as closed, I think it is still open, I visited the site today.
daemonfire300
A: 

Yup, it was dumb.

Missing tags at the beginning and end of the file.

Jim Rootham