Extending common classes to allow better customization

Comparing #3 with #4

Revision #4 was created by Steve Friedl Steve Friedl on Apr 4, 2011, 4:15:33 PM.

The framework base class is in fact CController, and Controller is the blog demo's helper class. Fixed a previous revision, plus added the note about the blog demo Controller helper class

Content

[...]
```php
<?php
// in protected/components/MyController.php

class MyController extends
CController {

}
[...]
Note: the common Yii convention is to remove the leading `C` when creating custom classes, by I believe it's more obvious that these are user-defined classes by using the `My` prefix. But choose the convention you prefer.

Note#2: If you're looking at the Blog demo, the application controllers **already** extend from `protected/components/Controller.php`, which is the blog's helper class of this kind - no need to extend it again.
 
 
Once these class files have been created, edit each of your controllers and models:

```php
// in protected/controllers/PostController.php

class PostController extends MyController {
[...]