It is difficult to perform user dependent theming through a general configuration in 'main.php'.
This article proposes a method to do so through a Factory that dynamically generates classes to allow delayed resolution of actual user values.
This means that you can refer to values that are stored in the database through the CActiveRecord before Yii is actually loaded.
The values will be fetched from the database when actually used for the first time, which is after Yii is loaded.
Actually, you can use pretty much any method that relies on Yii with this method.
You would find having such a need in most Yii Projects. Your database needs a specific format to store date fields, while you may want to display it in different formats to the users on forms and other views.
There is an issue on Yii2 to redirecting / urls to /frontend/web.
In other words we need a way to hidden /frontend/web from addresses.
We will do this without changing Apache configuration and creating virtual host or setting document root (It's good for share hostings that we have not access to apache.conf)
This Behaviour helps to view time/date/timestamp/datetime from db to local Date / Time / Date Time format and in local Timezone. And save into db in with db timezone and db format. You only need to include this behaviour in models where need this facility.
With the adoption of PJax on Yii2 things have change quite a bit with GridView when it comes to work with them in AJAX mode. It will probably be confusing at the beginning, but then you will soon realize how powerful the new approach is.