Book Image

Yii2 Application Development Solutions ??? Volume 2 [Video]

By : Andrew Bogdanov, Dmitry Eliseev
Book Image

Yii2 Application Development Solutions ??? Volume 2 [Video]

By: Andrew Bogdanov, Dmitry Eliseev

Overview of this book

Yii is an optimal, high-performance PHP framework for developing Web 2.0 applications. It provides fast, secure, and professional features to create robust projects; however, this rapid development requires the ability to organize common tasks collectively to build a complete application. Being extremely performance-optimized, Yii is the perfect choice for projects of any size. It comes packaged with tools to help test and debug your application and has clear and comprehensive documentation. This video course is a collection of Yii2 videos. Each video is represented as a full and independent item, showcasing solutions from real web applications. So you can easily reproduce them in your environment and learn Yii2 rapidly and painlessly… In this video, you will get started by configuring your Yii2 application. After that, we will focus on how to make our extension as efficient as possible. Then we will cover some best practices for developing an application that will run smoothly until you have very high loads. Moving ahead, we will provide various tips, which are especially useful in application deployment and when developing an application in a team. Later, we will introduce the best technologies for testing and we will see how to write simple tests and avoid regression errors in our application. Finally, we conclude this course by discussing review logging, analyzing the exception stack trace, and implementing our own error handler.
Table of Contents (6 chapters)
Chapter 2
Extending Yii
Content Locked
Section 2
Creating Model Behaviors
There are many similar leading products such as Google's Gmail that define nice UI patterns. One of these is soft delete. Instead of a permanent deletion with tons of confirmations, Gmail allows us to immediately mark messages as deleted and then easily undo it. The same behavior can be applied to any object such as blog posts, comments, and so on. - Create a behavior that will allow marking models as deleted, restoring models, selecting not yet deleted models, deleted models, and all models - Follow a test-driven development approach to plan the behavior and test if the implementation is correct