Articles in category "how-tos", sorted by date (updated)X
Displaying 81-90 of 354 result(s).

Use CGridview to sort and filter CSqlDataProvider - when used with UNRELATED tables (or complex queries)

Updated about a year ago by Gerhard LiebenbergHow-tos6 comments – viewed 14,993 times – version 1.1
I have two tables called hospitals and departments. I have a junction table between them which holds the departments in each hospital. But sometimes I need a list of "All hospitals with All possible departments" - regardless of whether they are linked in the junction table or not.

Yii configuration: Dynamic & User dependent

Updated 2 years ago by le_topHow-tos0 comments – viewed 4,782 times – ( +1 ) – version 1.1
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.

Save and Display Date/Time Fields in different formats in Yii2

Updated 2 years ago by Kartik VHow-tos12 comments – viewed 84,461 times – ( +39 ) – version 2.0
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.

Yii 2.0: Write & use a custom Component in Yii2.0 (Advanced Template)

Updated 2 years ago by Deepak PradhanHow-tos1 comment – viewed 18,373 times – version 2.0
This is an extension to Yii 2.0: Write & use a custom Component in Yii2.0 for Advanced Template

how to make a dynamic progress bar to show the percentage or status

Updated 2 years ago by BoazHow-tos1 comment – viewed 27,000 times – ( +5 ) – version 1.1
Yii have a CJuiProgressBar, but it is static. If we want a dynamic progress bar to show the percentage or status, we have to do more things. I make it successfully and am glad to share it with you.

MongoDB's RBAC support class extending BaseManager

Updated 2 years ago by edoardo849How-tos1 comment – viewed 5,748 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 years ago by Rohit SutharHow-tos56 comments – viewed 331,279 times – ( +113 / -1 ) – version 1.1
This article will explain how to create a REST API with the Yii framework.

How to use GridView with AJAX

Updated 2 years ago by YiiJekaHow-tos6 comments – viewed 45,172 times – ( +14 ) – 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 2 years ago by frazelliHow-tos5 comments – viewed 9,210 times – ( +5 ) – version 1.1

Add Beautiful Radio/Checkbox Buttons To Grid

Updated 2 years ago by Rohit SutharHow-tos1 comment – viewed 22,710 times – ( +10 / -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.