O'Reilly logo

Web Application Development with Yii 2 and PHP by Jeffrey Winesett, Mark Safronov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Events and Behaviors

In this chapter, we'll return to our decoupled design introduced in Chapter 2, Making a Custom Application with Yii 2. We left the customer domain model as it was and explored the various separate helpful features of the Yii 2 framework. Now, let's go back to the customer model and implement some of its interesting and useful behaviors, which will undoubtedly be needed for any business application. While implementing this behavior, we'll learn about two related concepts from the Yii 2 framework: events and behaviors.

Automatically marking database records with the timestamp and user ID

Let's implement one useful feature, which you'll undoubtedly be asked to use one day by the client on a real enterprise-grade application ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required