Difference between #1 and #5 of
Extending common classes to allow better customization

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->setFlash
FailureError('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:
[...]
36 0
19 followers
Viewed: 42 210 times
Version: 1.1
Category: Tips
Tags:
Written by: Steve Friedl
Last updated by: Steve Friedl
Created on: Dec 17, 2010
Last updated: 13 years ago
Update Article

Revisions

View all history