What this book covers
Chapter 1, Fundamentals, covers how to install the Yii Framework and different ways to install it. We will introduce you to application templates: basic and advanced and what is difference between them. Then you will learn about dependency injection container. This chapter contains info about model events, which are triggered after some simple actions such as model saving and updating and another. We will learn how to use external code which will include ZendFramework, Laravel, and Sympony in examples. We will also learn how to update your yii-1.x.x based application to yii2 step-by-step. A few more recipes are available at https://www.packtpub.com/sites/default/files/downloads/4270OS_Chapter1.pdf.
Chapter 2, Routing, Controllers, and Views, teaches some handy things about the Yii URL router, controllers, and views. You will be able to make your controllers and views more flexible.
Chapter 3, ActiveRecord, Model, and Database, discusses the three main methods to work with databases in Yii: Active Record, query builder, and direct SQL queries through DAO. All three are different in terms of syntax, features, and performance. In this chapter we will learn how to work with the database efficiently, when to use models and when not to, how to work with multiple databases, how to automatically preprocess Active Record fields, and how to use powerful database criteria.
Chapter 4, Forms, covers how Yii makes working with forms a breeze and the documentation on it is almost complete. Still, there are some areas that need clarification and examples.
Chapter 5, Security, discusses how to keep your application secure according to the general web application security principle "filter input, escape output." We will cover topics such as creating your own controller filters, preventing XSS, CSRF, and SQL injections, escaping output, and using role-based access control.
Chapter 6, RESTful Web Services, covers how to write RESTful Web Services using Yii2 and built-in features.
Chapter 7, Official Extensions, explains us how to install and use official extensions in your project. You will learn how to write your own extension and share it for another developers.
Chapter 8, Extending Yii, covers not only how to implement your own Yii extension, but also how to make your extension reusable and useful for the community. In addition, we will focus on many things you should do in order to make your extension as efficient as possible.
Chapter 9, Performance Tuning, teaches some best practices of developing an application that will run smoothly until you have very high loads. Yii is one of the fastest frameworks out there. Still, when developing and deploying an application, it is good to have some extra performance for free, as well as following best practices for the application itself. In this chapter, we will see how to configure Yii to gain extra performance. In addition, we will learn some best practices for developing an application that will run smoothly until we have very high loads.
Chapter 10, Deployment, covers various tips, which are especially useful on application deployment and when developing an application in a team, or when you just want to make your development environment more comfortable.
Chapter 11, Testing, teaches us how to use the best technologies for testing such as Codeception, PhpUnit, Atoum, and Behat. You will be introduced how to write simple tests and how to avoid regression errors in your applicaiton.
Chapter 12, Debugging, Logging, and Error Handling, discusses review logging, analyzing the exception stack trace, and implementing our own error handler. It is not possible to create a bug-free application if it is relatively complex, so developers have to detect errors and deal with them as fast as possible. Yii has a good set of utility features to handle logging and handling errors. Moreover, in the debug mode, Yii gives you a stack trace if there is an error. Using it, you can fix errors faster.