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 8. Routing, Responses, and Events

Like many modern web frameworks, Yii2 is built with a powerful router component, which we can utilize to handle a variety of URIs coming from both our end users and application. This functionality is further enhanced by Yii2's powerful request and response handlers, which we can use to manipulate request and response bodies. In this chapter, we'll cover the basics of how to manipulate Yii2's URL Manager to adjust routes, explore how to configure Yii2 to respond in different ways, and learn how to send and listen to events within our application.

Routing

As mentioned in previous chapters, routing within Yii2 is managed by the UrlManager component defined in our application configuration. The router in Yii2 ...

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