Wiki

Sorted by viewsX
Displaying 421-430 of 785 result(s).

Customizing Yii's formatting rules (extending CFormatter)

Created 5 years ago by HaenselTips0 comments – viewed 16,545 times – ( +14 ) – version 1.1
CFormatter is one of Yii's core components and used to format values displayed in widgets like CGridView or CDetailView. All classic formats like numbers, text, urls or datetime are supported but you may have to use a formatting rule that isn't built in. Let's say we want to display arrays of strings (like tags associated with a product model). When using CDetailView we would usually make use of PHPs implode function to create a simple string value of all values in the $product->tags array.

Impersonate Users within Yii Framework

Created 5 years ago by WoilTutorials6 comments – viewed 16,533 times – ( +22 ) – version 1.1
For some applications it can be advantageous for administration reasons to allow site administrators to login as other users. This is sometimes called user impersonation or "becoming that user".

Get 'source' data from the database - for TbEditableColumn or EditableColumn ('type'=>'select' / dropdownlist)

Created 3 years ago by Gerhard LiebenbergHow-tos0 comments – viewed 16,484 times – ( +4 / -1 ) – version 1.1
If you want to edit data directly in the gridview in a 'dropdownlist' style, then you could use the 'type' => 'select' option of TbEditableColumn (YiiBooster) or EditableColumn (x-editable for Yii). This wiki shows how to get data from the db for the 'dropdownlist', by converting AR model data into an array that is passed in json format.

How to change the confirmation message on admingridview button and call a ajax..Dynamic

Created 3 years ago by Ankit ModiTips0 comments – viewed 16,315 times – ( +3 ) – version 1.1
Hi Friends,

Simple Way to Upload and Save File

Created 2 years ago by Misbahul D MunirTutorials0 comments – viewed 16,284 times – ( -2 ) – version 2.0
This tutorial need extension mdmsoft/yii2-upload-file. Follow the intruction to install. After installation done, create controller and action

Open Dialog from ajax content

Created 3 years ago by TouzasHow-tos1 comment – viewed 16,187 times – ( +4 / -1 ) – version 1.1
This tutorial will show you how to create Ajax dialog. It's very simple code.

Upload CSV File

Created 4 years ago by bhavesh vaghelaTutorials2 comments – viewed 16,177 times – ( +8 ) – version 1.1
View file

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

Created 2 years ago by Gerhard LiebenbergHow-tos6 comments – viewed 16,169 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.

Remove Byte Order Mark (BOM) from files recursively

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos3 comments – viewed 16,116 times – ( +5 / -1 ) – version all
Ok, this wiki is not only for yii projects.

How to hide `index` action from URL

Created 4 years ago by rootbearHow-tos2 comments – viewed 16,071 times – ( +3 / -2 ) – version 1.1
Here is my experiment inspired by my own question and others from the forum.
tags: index