Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Yii2 Application Development Cookbook
  • Toc
  • feedback
Yii2 Application Development Cookbook

Yii2 Application Development Cookbook

By : Andrew Bogdanov, Eliseev
4.5 (2)
close
Yii2 Application Development Cookbook

Yii2 Application Development Cookbook

4.5 (2)
By: Andrew Bogdanov, Eliseev

Overview of this book

Yii is a free, open source web application development framework written in PHP5 that promotes clean DRY design and encourages rapid development. It works to streamline your application development time and helps to ensure an extremely efficient, extensible, and maintainable end product. Being extremely performance optimized, Yii is a perfect choice for any size project. However, it has been built with sophisticated, enterprise applications in mind. You have full control over the configuration from head-to-toe (presentation-to-persistence) to conform to your enterprise development guidelines. It comes packaged with tools to help test and debug your application, and has clear and comprehensive documentation. This book is a collection of Yii2 recipes. Each recipe is represented as a full and independent item, which showcases solutions from real web-applications. So you can easily reproduce them in your environment and learn Yii2 fast and without tears. All recipes are explained with step-by-step code examples and clear screenshots. Yii2 is like a suit that looks great off the rack, but is also very easy to tailor to fit your needs. Virtually every component of the framework is extensible. This book will show how to use official extensions, extend any component, or write a new one. This book will help you create modern web applications quickly, and make sure they perform well using examples and business logic from real life. You will deal with the Yii command line, migrations, and assets. You will learn about role-based access, security, and deployment. We’ll show you how to easily get started, configure your environment, and be ready to write web applications efficiently and quickly.
Table of Contents (14 chapters)
close
13
Index

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.

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete