O'Reilly logo

Mastering Yii by Charles R. Portwood II

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 4. Active Record, Models, and Forms

Like many modern web frameworks, Yii2 comes with several powerful classes to represent data both in and out of our database. These classes enable us to abstract our data management code away from DAO and Query Builder and into an easy-to-use programmatic interface. In this chapter, we'll cover the use and implementation of Active Record and learn how to create data models and custom forms. We'll also cover how to configure a powerful code generation tool called Gii to automate the creation of Active Record models and forms.

Configuring Gii

While Active Record models and forms can be generated by hand, in most cases, we'll want to automate the creation of this code. To achieve this, Yii2 provides a code ...

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