$model

When I create an application using YIIC, every new file it seems uses the variable $model. This makes reading the code an unhappy task.

While reading the Blog tutorial, it can be seen that a saner variable naming method is used, eg. if I am working with the CommentController and comment class, these use the varible $comment. If I am working with PostController and post class then the variable is $post, if UserController and user class then $user.

Why is this convention not used, when your own tutorial points to this being a far better naming convention? With $model all over the place it is very difficult to keep track of things that would be very simple using unique variable names based on the name of the controller/model.

i think you’re speaking about the generated code by yiic tool.

so, it might be just some a way that the coder did when he/she was creating the script.

it doesn’t mean that you don’t have to follow a code convention.

you can follow a different and more readble convention just by renaming the variable that will be set via controller.

Yes, clearly I am talking about the YIIC tool.

My question is also clearly directed toward the developers ;)

The reason for using $model is that it is independent of the model name. As a result, it is more likely that you can "reuse" your views.

Ok, that makes sense.

Any chance of the blog tutorial being updated accordingly?