Extending Yii is a common action during web development. Like when we write a new controller, we extend Yii by inheriting its CController class; when we write a new widget, we will extend CWidget or an existing class. If the code is designed to be reused by third-party then we call it an extension.