Wiki

Articles in category "how-tos", sorted by date (updated)X
Displaying 1-10 of 312 result(s).

How to hide /frontend/web in url addresses on apache

Updated a day ago by raminiousHow-tos0 comments – viewed 2,875 times – version 2.0
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)

MongoDB's RBAC support class extending BaseManager

Updated 2 days ago by edoardo849How-tos0 comments – viewed 431 times – version 2.0
Here's a possible implementation for MongoDb of the RBAC standard. Create a class "MongoDbManager" in common\components and modify your params.php file like this:
tags: mongodb, rbac, yii2

How-To: Create a REST API

Updated 2 days ago by Rohit SutharHow-tos54 comments – viewed 218,335 times – ( +107 / -1 ) – version 1.1
This article will explain how to create a REST API with the Yii framework.

Behaviour for Time Zone and Format conversion for Date, Time, timestamp, and datetime

Updated 5 days ago by SmitheshHow-tos0 comments – viewed 722 times – ( +2 ) – version 1.1
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.

How to use GridView with AJAX

Updated 5 days ago by YiiJekaHow-tos0 comments – viewed 4,983 times – ( +4 ) – version 2.0
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.
tags: yii2, pjax, widget

Check users online, user last activity, user last ip

Updated 13 days ago by frazelliHow-tos3 comments – viewed 1,645 times – ( +1 ) – version 1.1
DbHttpSession

How to translate and do the translations the easy way

Updated 16 days ago by Roman SolomatinHow-tos3 comments – viewed 45,314 times – ( +26 / -2 ) – version 1.1
I wanted to keep all the I18N related translations in separate files, so that I would not need to modify the view files or the model files every time I need to update or fix the translations of application's source language.
tags: i18n

How to implement form events

Updated 19 days ago by Antonio RamirezHow-tos4 comments – viewed 1,964 times – ( +5 ) – version 2.0
You have that, when a product is on development they can change its API anytime. This change is quite important though, its related on how to set the events of your form, for example, the useful beforeSubmit.
tags: yii2, forms, how to

Add Beautiful Radio/Checkbox Buttons To Grid

Updated 19 days ago by Rohit SutharHow-tos1 comment – viewed 14,015 times – ( +9 / -2 ) – version 1.1
This is a tutorial on how to create slick looking status buttons to update a model's status via a grid. Note** This tutorial uses Yii Bootstrap for styling.

How to get & store Last Login DateTime in database?

Updated 20 days ago by Rohit SutharHow-tos2 comments – viewed 2,394 times – ( +6 ) – version 1.1
In this wiki I will show how could be store last login date & time in database. First we need a field LastLoginTime (Type must be datetime). this field store a user login detalis (like - Date & Time).