Yii2 – GridView set default sort column

This tutorial will teach you, setting default specific sort column for your GridView. With the following code, you can set the specific column as default sorting column. Possible sorting options are SORT_DESC and SORT_ASC. Change ‘columnName’ to the name of the column to be sorted by.

Yii2 Transaction

In this tutorial, I would like to show you how we can use transactions in YII2. A transaction is used to run a group of operations in the single process means a transaction is a unit of work. Why should I use transaction? In database we may need to perform add, update or delete operations… Continue reading Yii2 Transaction

How to make a drop down list in yii2?

In this tutorial, I would like to show you making the dropdown list in yii2 using different data sources like static array data and database table modal data. First I would like to share basic syntax – here you go… Yii2 DropDownList syntax – active field style

Yii2 DropDownList syntax – active form style… Continue reading How to make a drop down list in yii2?

How to change app name in Yii2

Yii2 Change app name

Yii2 Default application name is “My Application”. You can change this name by editing the config/main.php. Just add the application name property in Config Array. NOTE: If you’re using the advanced app you will need to change the frontend and backbend config/main.php files.

You can access site or app name with Yii::$app->name. Ref: http://www.yiiframework.com/doc/api/1.1/CApplication#name-detail

How to make a drop down list in yii2

How to make a drop down list in yii2

In this post, I would like to show you how to create a drop-down list in yii2. This tutorial will help you to display the array data or model data in the drop-down list. I am using activeForm. Drop down list syntax

Drop down list with Array

Drop down list with prompt

Continue reading How to make a drop down list in yii2