Web Application Development with Yii 2 and PHP

Fast-track your web application development using the new generation Yii PHP framework

Web Application Development with Yii 2 and PHP

This ebook is included in a Mapt subscription
Mark Safronov, Jeffrey Winesett

2 customer reviews
Fast-track your web application development using the new generation Yii PHP framework
$0.00
$21.99
$35.99
$29.99p/m after trial
RRP $21.99
RRP $35.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781783981885
Paperback406 pages

Book Description

Yii is a high performance PHP framework used for rapid web application development. It is well designed, well supported, easy to learn, and easy to maintain. This book embraces the learn-by-example methodology to show you the most important features of the Yii 2 framework. Throughout the course of this book, you will build a simple real-world application; each chapter will introduce you to a new functionality and show you how to tweak your application. Instead of trying to be an all-encompassing reference about the framework, this is a walkthrough of the really important pieces of information that you have to understand in detail.

You will learn how to use Yii's active record and CRUD scaffolding to manage the data in your database. Authentication, extensions, events and behaviors, and route management are just some of the many other features of Yii that you will learn from this book. By the end of this book, you will have a basic CRM application that is all set for service!

Table of Contents

Chapter 1: Getting Started
A basic application
An advanced application
Summary
Chapter 2: Making a Custom Application with Yii 2
The design stage
Initial preparations
Introducing the Yii framework into our application
Making the data and application layers
Creating the user interface
Using the application
Summary
Chapter 3: Automatically Generating the CRUD Code
Definition of the model to work with
Using Gii
Finishing touches
An overview of the generated CRUD UI
Pros and cons of generated classes over manually created ones
Summary
Chapter 4: The Renderer
Anatomy of Yii rendering
The Yii application components
The View component
Custom renderers
A custom response formatter
The asset bundles
Themes
Widgets
Summary
Chapter 5: User Authentication
Anatomy of the user login in Yii
Password-based login mechanics in general
Making the user management interface
Hashing a password upon saving a user record
Making a user record into an identity
Making the login interface
Summary
Chapter 6: User Authorization and Access Control
Access control using the state of user authentication
Role-based access control
Protecting the CRM management from CRM users
Summary
Chapter 7: Modules
FEATURE – Yii modules
Building the API module
Retrospective on the modules mentioned in previous chapters
Summary
Chapter 8: Overall Behavior
FEATURE – message log
FEATURE – profiling
Error handling details
Caching
Minimizing the assets
Summary
Chapter 9: Making an Extension
Extension idea
Creating the extension contents
Making the extension installable as... erm, extension
Summary
Chapter 10: Events and Behaviors
Automatically marking database records with the timestamp and user ID
FEATURE – behaviors
FEATURE – events
Built-in events
Summary
Chapter 11: The Grid
Dismissing of the domain layer
Designing for the customers' index
FEATURE – widgets
Creating the index page for customers
Summary
Chapter 12: Route Management
Yii 2 routing 102
FEATURE – routing using names of modules, controllers, and actions
Custom routes using a configuration
Custom routes using custom URL rule classes
Summary
Chapter 13: Collaborative Work
Configuration construction
Console application
Database migrations
Summary

What You Will Learn

  • Build a complete application boilerplate with a single shell command and transform it into a running website with another
  • Generate code for routine CRUD interface pages
  • Make a vile extension just for fun and learn how to attach it to a target application
  • Control and customize the output that will be sent to the client browser
  • Authenticate users using a classic password-based technique and authorize them using role-based access control
  • Prepare your application for multiple users and deployment to a production environment
  • Answer mind-boggling SEO feature requests by modifying the route handling mechanism

Authors

Table of Contents

Chapter 1: Getting Started
A basic application
An advanced application
Summary
Chapter 2: Making a Custom Application with Yii 2
The design stage
Initial preparations
Introducing the Yii framework into our application
Making the data and application layers
Creating the user interface
Using the application
Summary
Chapter 3: Automatically Generating the CRUD Code
Definition of the model to work with
Using Gii
Finishing touches
An overview of the generated CRUD UI
Pros and cons of generated classes over manually created ones
Summary
Chapter 4: The Renderer
Anatomy of Yii rendering
The Yii application components
The View component
Custom renderers
A custom response formatter
The asset bundles
Themes
Widgets
Summary
Chapter 5: User Authentication
Anatomy of the user login in Yii
Password-based login mechanics in general
Making the user management interface
Hashing a password upon saving a user record
Making a user record into an identity
Making the login interface
Summary
Chapter 6: User Authorization and Access Control
Access control using the state of user authentication
Role-based access control
Protecting the CRM management from CRM users
Summary
Chapter 7: Modules
FEATURE – Yii modules
Building the API module
Retrospective on the modules mentioned in previous chapters
Summary
Chapter 8: Overall Behavior
FEATURE – message log
FEATURE – profiling
Error handling details
Caching
Minimizing the assets
Summary
Chapter 9: Making an Extension
Extension idea
Creating the extension contents
Making the extension installable as... erm, extension
Summary
Chapter 10: Events and Behaviors
Automatically marking database records with the timestamp and user ID
FEATURE – behaviors
FEATURE – events
Built-in events
Summary
Chapter 11: The Grid
Dismissing of the domain layer
Designing for the customers' index
FEATURE – widgets
Creating the index page for customers
Summary
Chapter 12: Route Management
Yii 2 routing 102
FEATURE – routing using names of modules, controllers, and actions
Custom routes using a configuration
Custom routes using custom URL rule classes
Summary
Chapter 13: Collaborative Work
Configuration construction
Console application
Database migrations
Summary

Book Details

ISBN 139781783981885
Paperback406 pages
Read More
From 2 reviews

Read More Reviews