Archives For event

Much of the work done with models involves using the methods defined within the model classes. These methods, such as rules() and relations(), are created by the code generator Gii. You’ll also add your own methods to the code generated for you. But, thanks to inheritance, there are lots of methods common to Yii models that you’ll frequently use. In this post, I want to specifically look at methods used to handle model-related events. Before looking at the usage of these methods, let’s first look at event handling in Yii in general.

Continue Reading...