Changes
Title
unchanged
Extending common classes to allow better customization
Category
unchanged
Tips
Yii version
unchanged
Tags
unchanged
Content
changed
[...]
}
```
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[...]
$this->setFlashSuccess('Action completed successfully!');
else
$this->setFlashFailureError('Could not complete the action');
...
}
```
Now, the success or failure of the action will be displayed in a small banner at the top of the next refresh, disappearing after that. Many find this version easier to read than:[...]