Book Image

Mastering Yii

By : Charles R. Portwood ll
Book Image

Mastering Yii

By: Charles R. Portwood ll

Overview of this book

The successor of Yii Framework 1.1, Yii 2 is a complete rewrite of Yii Framework, one of the most popular PHP 5 frameworks around for making modern web applications. The update embraces the best practices and protocols established with newer versions of PHP, while still maintaining the simple, fast, and extendable behavior found in its predecessor. This book has been written to enhance your skills and knowledge with Yii Framework 2. Starting with configuration and how to initialize new projects, you’ll learn how to configure, manage, and use every aspect of Yii2 from Gii, DAO, Query Builder, Active Record, and migrations, to asset manager. You'll also discover how to automatically test your code using codeception. With this book by your side, you’ll have all the skills you need to quickly create rich modern web and console applications with Yii 2.
Table of Contents (20 chapters)
Mastering Yii
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
5
Modules, Widgets, and Helpers
13
Debugging and Deploying
Index

Chapter 7. Authenticating and Authorizing Users

When working with modern web applications, we often need to authenticate our users to ensure that they are who they claim to be and that they have the appropriate permissions (authorization) required to access information. In this chapter, we'll cover the basics of authenticating users with Yii2 and granting them access to specific pages within our applications using basic access control filters and more complex role-based access control filters.

Tip

In this chapter, we'll be building upon the migration scripts and models we created in Chapter 4, Active Record, Models, and Forms. Before starting this chapter, make sure you have a good understanding of the models and migrations we created in that chapter.