Yii is the premium PHP framework for developing web applications. It provides components to simplify every aspect of web development, including authentication, authorization, and automated testing, offering a comprehensive ORM called ActiveRecord, and the option to perform performance tuning. We can use all of these features out-of-the-box, or even customize them based on our project requirements.
The more applications we develop for the web, the more aware we become that we’re spending time on the same repetitive tasks. Learning Yii 2 demonstrates how it is entirely possible to write quality applications fast. This course will show you how to create a basic but fully functional dating site for monsters. All this with minimal effort on your part, because the Yii framework simplifies the overhead work.
We’ll start by installing Yii's basic application template via Vagrant. Before you know it, you’ll have a fully-functional web application that is ready to be customized. You’ll learn to generate Models, Views, and Controllers, and debug and test them with the Debug Toolbar and Codeception. As we continue, you’ll learn to modify that generated code to create a registration page, a profile page, and a listing page, as well as a search interface using ActiveQuery and TypeAhead. We’ll also use ACF and RBAC to boost the security of our website.
By the end, you’ll be comfortable using Yii 2 to develop your own personal and professional web applications.
About The Author
Matthew Beaumont has been interested in technology since his father brought home a Radio Shack TRS-80 in the late 1980s. After six years in music school, he returned to the technology field and founded Beaumont Web Development, LLC, which is a boutique web-development firm located just across the Hudson River from New York City. In addition to his development work, he also plays classical percussion and has appeared in concerts at Lincoln Center, Carnegie Hall, and Radio City Music Hall. He has also published several articles on web development for Sitepoint.
This video will offer the overview of the course.
It takes a lot of time to set up a development environment for an application. Learn how to quickly create and configure a development environment on our local PC, so we can begin programming our application.
Learn how to easily install the Yii 2 basic application template, which is the starting point for any Yii-based project.
Understand where Yii stores various files within the basic application template.
Introduce application components, describe how to change their default configuration, and then explain how to extend a core component to add functionality.
Learn how to configure Gii, which is a tool that quickly generates code templates in order to cut development time dramatically.
Learn to generate models with Yii, and then describe Yii’s model features.
Learn to generate controllers with Gii, and then describe Yii’s controller features.
The presentation logic in an application should be isolated, and contain a minimal amount of PHP. We’ll learn how to generate views using Gii as well as how to use them.
Learn how to configure and use Yii's built-in debugging module.
Automated testing can be difficult to configure and implement. Yii ships with an integrated version of the Codeception testing framework in order to simplify the process of writing automated tests.
Learn how to use Codeception to write and execute unit tests for our application.
Learn how to use Codeception to write and execute functional tests for our application.
Learn how to use Codeception to write and execute acceptance tests for our application.
Every application needs a means to authenticate users. We’ll explore the auto-generated User model that comes with the Yii 2 basic application template.
The default user is very limited and requires changes to the code to add users or edit their data. We’ll create a better user using the database and then learn how to easily hash their password.
The application doesn’t have a way to easily create new users. We will create a registration page to allow new users to create accounts.
Guests (users who have not logged in) should not be able to update and delete profiles. Use Access Control Filter to restrict access to these pages.
ACF only allows the ability to block access to controller actions. For finer-grained over access to application features, use the AuthManager component to implement Role Based Access Control (RBAC).
Some visual aspects of a web application are common to multiple pages, and having to update those aspects in each page would be very tedious. We’ll learn how to use Yii layouts to manage our common UI elements.
Dynamic web applications often mix too much HTML and PHP in order to generate HTML content. The HtmlHelper attempts to solve this by providing PHP methods to generate clean HTML.
The current profile (view) page is not very appealing, so we'll use some of the skills we've learned in the previous videos to spice it up.
A dating site needs a method for users to search for their match. Yii’s ActiveQuery component makes generating complex SQL queries very easy.
Sometimes, simply presenting a user with a text field in a search UI leaves them feeling overwhelmed. We can use the TypeAhead widget to provide meaningful suggestions for search terms.
We've been using the GridView widget to display results, but it is really more suitable in an admin panel than a customer-facing page. We’ll learn how to use the ListView widget to improve the appearance of our listing page.
Sometimes, an application needs multiple themes in order to display data in different ways to different users or under different circumstances. We’ll learn how to use themes to address this issue.
Applications frequently need to send e-mails. We’ll learn how to use the built-in Swiftmailer component in order to easily send HTML e-mails.
Our application requires users to manually copy images to the photo directory, which they wouldn’t have access to in production. We’ll learn how to upload files through a form with Yii, and then learn how to manipulate them using the Imagine extension.
Managing database changes with multiple .sql files is slow and prone to error. Yii’s migration class helps manage database changes.
Not everyone speaks the same language. So, we’ll learn how to use the i18n component of Yii in order to translate our application into other languages.
Packt has been committed to developer learning since 2004. A lot has changed in software since then - but Packt has remained responsive to these changes, continuing to look forward at the trends and tools defining the way we work and live. And how to put them to work.
With an extensive library of content - more than 4000 books and video courses -Packt's mission is to help developers stay relevant in a rapidly changing world. From new web frameworks and programming languages, to cutting edge data analytics, and DevOps, Packt takes software professionals in every field to what's important to them now.
From skills that will help you to develop and future proof your career to immediate solutions to every day tech challenges, Packt is a go-to resource to make you a better, smarter developer.
Packt Udemy courses continue this tradition, bringing you comprehensive yet concise video courses straight from the experts.