Preface

This book covers the use of the Yii2 framework from scratch up to build a complete web application.

Yii is a high-performance PHP framework that is best for developing Web 2.0 applications that provide fast, secure, and professional features to rapidly create robust projects. However, this rapid development requires the ability to organize common tasks together to build a complete application. It's all too easy to get confused about the use of these technologies.

So, walking through practical examples will help you understand how these concepts must be used and realize a successful application.

What this book covers

Chapter 1, Starting with Yii2, provides basic knowledge about the Yii2 framework, starting from requirements to explain every single functionality. Then, we will use debugging and logging tools to trace our code and provides find errors. Finally, we will write our first project based on the basic template.

Chapter 2, Creating a Simple News Reader, creates our first controllers and relative views. We will explore static and dynamic views, learn how to render views in layout and pass data from controller to view, and then look at reusing views through partial views and blocks.

Chapter 3, Making Pretty URLs, shows how to implement pretty URLs, which is useful for search engine optimization. We will also create examples where we used custom rules to parse and create the URL. Finally, we will learn how to build more customized URL rules through Rule classes.

Chapter 4, Creating a Room through Forms, shows how to build a Model class from scratch and send data from view to controller using form, which is created using the Yii2 ActiveForm widget. We will also look at commonly used methods to format data and send files from the form.

Chapter 5, Developing a Reservation System, explains how to configure a database connection and execute SQL queries from scratch with DAO support for the framework. Next, we will find out how to use Gii and get to know about the advantages it has in creating models from the database table structure. Gii creates models that extend the ActiveRecord class, and, through its use, we will finally learn how to manipulate data.

Chapter 6, Using a Grid for Data and Relations, presents the GridView widget for displaying data, directly or relationed. A fundamental topic inside GridView is Data Provider, the way to provide data to GridView. We will learn how to get Data Provider from ActiveRecord, Array, or SQL, based on the available sources.

Chapter 7, Working on the User Interface, discusses the User Interface and how Yii helps us with its core functionalities.

Chapter 8, Log in to the App, shows how to apply user authentication and authorization to an app. The first step is to create authenticated access to the application. For this purpose, we will create a database table to manage users and associate it to the Yii user component through a user model that extends IdentityInterface.

Chapter 9, Frontend to Display Rooms to Everyone, explains how to use Yii to build a modern web project based on frontend and backend applications. We will find out the differences between basic and advanced templates, installing our first advanced project based on advanced templates.

Chapter 10, Localize the App, shows how to configure multiple languages in our app. We will discover that there are two storage options to handle internationalization: files and databases.

Chapter 11, Creating an API for Use in a Mobile App, creates an API for use in mobile apps through the use of powerful tools provided by Yii. We will adopt the approach of creating a new application in order to distribute RESTful Web Services, instead of mixing web and API controllers.

Chapter 12, Create a Console Application to Automate the Periodic Task, explains how to write a console application and allows you to discover the main differences between web and console apps.

Chapter 13, Final Refactoring, helps you to reuse code using widgets and components. We will create some practical examples on how to use them.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.137.64