Wiki

Articles in category "how-tos", sorted by viewsX
Displaying 191-200 of 354 result(s).

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

Created 3 years ago by Gerhard LiebenbergHow-tos0 comments – viewed 16,987 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.

How to hide `index` action from URL

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

Open Dialog from ajax content

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

get summary of related model via STAT relation

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

Sub-domains with different databases in Yii!

Created 5 years ago by jwerdHow-tos5 comments – viewed 16,403 times – ( +2 / -1 ) – version 1.1
Sub-domains with different databases in Yii!

Create sitemap.xml file dynamically on root folder with one hit

Created 4 years ago by kiran sharmaHow-tos1 comment – viewed 16,333 times – ( +5 / -6 ) – version 1.1
I had created one controller file which can create sitemap.xml file(which is used for seo, google crawler and many other puropse) dynamically with one run.
tags: SEO, SiteMap, XML

Insert a multirow header in CGridView

Created 3 years ago by PeppeHow-tos2 comments – viewed 16,266 times – ( +6 / -1 ) – version 1.1
The CGridView widget is very useful and customizable, but sometimes you need a little more. One limit I found is to have only one row for headers; yes, you can write each column header in more than one row, but just inside the single cell. I was looking instead for the possibility to use more than one row, with different structure one from the others. This way you can write columns grouping headers, and obtain a nicer view.

Changing Controllers Name

Created 6 years ago by TrejderHow-tos0 comments – viewed 16,266 times – ( +5 / -1 ) – version 1.1
This very short how-to presents steps required to change controller name. It is oriented for less experienced users, which are starting their journey with Yii, to avoid common newbie pitfalls.

How to handle decimal separators (e.g comma instead of dot) for l18n

Created 5 years ago by jpabloHow-tos2 comments – viewed 15,833 times – ( +2 / -1 ) – version 1.1
Yii i18n does not cover decimal format. Some languages like Spanish (I live in Argentina) uses comma ',' instead of dot '.' as decimal separator.