Wiki

Sorted by viewsX
Displaying 431-440 of 785 result(s).

Impersonate Users within Yii Framework

Created 6 years ago by WoilTutorials6 comments – viewed 17,249 times – ( +22 / -1 ) – 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 4 years ago by Gerhard LiebenbergHow-tos0 comments – viewed 17,192 times – ( +4 / -2 ) – 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.

Simple Mail Queue

Created 4 years ago by waterloomattTutorials3 comments – viewed 17,177 times – ( +10 / -3 ) – version 1.1
This tutorial shows how to create a simple mail queue. It is usually run from a cron job but can be run from the command line too.

Customizing Yii's formatting rules (extending CFormatter)

Created 5 years ago by HaenselTips0 comments – viewed 17,121 times – ( +14 / -1 ) – 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.

Extending CActiveForm for some form display fixes and language tweaks

Created 6 years ago by TrejderTips0 comments – viewed 17,114 times – ( +5 / -1 ) – version 1.1
In this simple example I'll demonstrate how to extend CActiveForm class to overload some drawing functions to achieve some commonly used fixes in forms.

How to hide `index` action from URL

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

get summary of related model via STAT relation

Created 3 years ago by rootbearHow-tos2 comments – viewed 16,891 times – ( +7 / -2 ) – version 1.1
typical scenario: invoice, invoice items.

Simple Jui Autocomplete in yii2

Created about a year ago by ajithTutorials4 comments – viewed 16,855 times – ( -2 ) – version 2.0
In this tutorial i will explain how to use jui auto complete in yii2. The Autocomplete widget enables users to quickly find and select from a pre-populated list of values as they type, leveraging searching and filtering.

Add model validator in Controller

Created 2 years ago by Kostas Apazidis (KonApaz)Tips4 comments – viewed 16,822 times – ( +1 / -2 ) – version 1.1
There are cases that model validators should be depended by controller/action and you couldn't manipulate on the model class or using scenarios in easy way

Adding a link to a CDataColumn

Created 4 years ago by le_topTips6 comments – viewed 16,800 times – ( +3 / -1 ) – version 1.1
Backoffice Grid Views often list information like Posts for a blog while showing at the same time linked information like the User who wrote that post. For more efficiency, it is appropriate that the User is displayed as a link to the User detail page.