$model
Same variable everywhereRate Topic:

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.

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.

Backslider, on 02 August 2009 - 11:37 PM, said:

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.

"no one person is smart enough or has enough knowledge to figure out everything without assistance"