Summary

In this chapter, after understanding how a Yii2 app is structured, we have created our first Controllers and relative views. We have seen static and dynamic views, we have learned how to render views in layout and pass data from Controller to View and then we have looked at reusing Views through partial views and blocks.

Finally, we have manipulated layouts, changing them conditionally.

In the next chapter, we will display URLs in a pretty format, which is very important for all search engine optimization (SEO) activities on the website. Then, we will learn how to create a custom URL handler to manage any required URL customizations.

Get Yii2 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.