Latest Tutorials

How to create Yii2 migrations

How to create Yii2 Migrations

Yii2 offers a great component for creating migrations. It is very simple to use however you need to understand some basic concepts behind database structures such as tables, rows, indexing, property types etc. You can control migration from the command line tool Yii2 offers (console). Create a migration To create a migration you can use […]

How to setup authentication in Yii2

How to setup authentication in Yii2

Thanks to Yii2 authentication system you can create an authentication pattern really fast. In this tutorial we will learn how to extend yii\web\User class to add basic register and login functionality to our app. Yii2 User Model overview When you first create a new Yii2 project you will probably have a User model such as this: […]

Set up Yii2 + MySQL with docker-compose

Yii2 MySQL Docker - How to Yii2

Docker is a widely used tool for working with virtual environments. You can set up your project within a virtual environment and then you can expect to work exactly the same way when you install it on another machine! This is mostly helpful if you have a lot of developers working on a project and everyone […]

Add dotenv support to your environment

Yii2 Dotenv Support how to tutorial

This tutorial will walk you through on how to add Dotenv support to your Yii2 project. Yii2 offers a pretty solid mechanism for controlling your environment but sometimes you might want to use something more simple. In most PHP projects you are mostly like to see the dotenv mechanism used. That allows you to use your […]

Pretty URLs: How to make SEO Friendly URLs in Yii2

Yii2 Prettry Urls

After setting up the basic installation for your Yii2 project, the next thing you might want to do next is to set up SEO friendly URLs also known as `pretty URLs`. If you didn’t follow the previous tutorial on how to install Yii2 you files structure might be a little different. Search for your `config` directory and […]

How to Install composer

How to install composer

Coming here you might be wondering ‘What is composer?’. Composer is a dependency manager tool which automates the process of installing the dependencies for your project. For example you might want to use a mailer library like SwiftMailer. With composer, you only need to run composer require “swiftmailer/swiftmailer:^6.0” and composer will load that library into […]


The easiest way to install Yii2 is by using composer. If you haven’t had any experience with composer before check out my tutorial on how to install and use composer. Install using composer To install Yii2 with composer is as easy as running composer create-project –prefer-dist yiisoft/yii2-app-basic myapp This will download Yii2 required files using the […]

Social media & sharing icons powered by UltimatelySocial