Wiki

Sorted by commentsX
Displaying 261-270 of 600 result(s).

CButtonColumn and Font Awesome icons

Created 8 months ago by DerekCTips3 comments – viewed 7,319 times – ( +4 )
I was looking for a way to use Font Awsome icons instead of the default images in a CGridView -> CButtonColumn. Perhaps this will be useful to someone.

Tabular Input, Validating and Saving related models

Created 7 months ago by Xavier JohnTutorials3 comments – viewed 10,158 times – ( +6 )
This tutorial shows how to use a model to save and validate related (MANY_MANY) models.

How to extend CFormatter, add i18n support to booleanFormat and use it in CDetailView

Created 2 years ago by c@cbaHow-tos3 comments – viewed 8,309 times – ( +9 ) – version 1.1
As you know, the CDetailView widget displays details of a single model. If no formatting is specified, boolean values that are stored in the database as 0 and 1, are represented in the detail view as 0 and 1. If formatted as boolean, they are represented as 'No' and 'Yes'. We want to add i18n support, so that Yes and No appear in the current language.

Encapsulate db and module configurations

Created 4 years ago by ricardogranaTutorials3 comments – viewed 8,671 times – ( +7 ) – version 1.1
This method was inspirated on the excellent text about different environments available at http://www.yiiframework.com/doc/cookbook/32/
tags: module

i18n All-in-one format and timezone conversions for date, time, timestamp and datetime.

Created 7 months ago by Gerhard LiebenbergHow-tos3 comments – viewed 7,034 times – ( +7 / -1 )
Most of the currently available functions/extensions/behaviors directly or indirectly use timestamps to perform "format" and "timezone" conversions. This creates problems for dates falling outside the timestamp range; and the two forms of conversions must often be done in separate processes. However, by using php's DateTime class (instead of timestamps), we can do both conversions on a single DateTime object (only 2 lines of code) for date, time, timestamp and datetime types - while php takes care of nightmares such as daylight saving times and more importantly, historical changes in timezones and daylight saving times.

Simple Share Widget for Facebook, twitter and google+

Created 2 years ago by softarkHow-tos3 comments – viewed 13,753 times – ( +10 ) – version 1.1
This widget will show a Facebook "like" button and "comments" box together with "tweet" button and "google plusone" button on your page.

AssetManager: clearing browser's cache on site update

Created 2 years ago by dhampikHow-tos3 comments – viewed 19,173 times – ( +17 ) – version 1.1
If you like the things to be short and clear, then you can skip right to a short summary of instructions at the end of this article.

SQL Logging and Profiling in FireBug (Yii 1.1)

Created 4 years ago by mindplayTutorials3 comments – viewed 17,087 times – ( +7 ) – version 1.1
During development, it's often very handy to have SQL logging and profiling.
tags: Logging

CGridView: Use special variable $data in the htmlOptions of a column (i.e. evaluate htmlOptions attribute)

Created 2 years ago by c@cbaTutorials3 comments – viewed 32,274 times – ( +25 / -1 ) – version 1.1
    For each column of the CGridView, we can specify name, value, htmlOptions, cssClassExpression etc. In the declarations of the attributes value and cssClassExpression we can use the "special" variable $data, for example like this: 'value'=>'$data->author->username',.     Now we might want to use $data in the declaration of the htmlOptions attribute, which is normally not possible, to generate for example the tag <td id="3" class="name_3">, where 3 is the id of the data model for the current row, i.e. $data->id. That is, we want to be able to use: 'htmlOptions'=>array('id'=>'$data->id', 'class'=>'"name_{$data->id}"')     Here's a way to accomplish this...

using multiple radio button

Created 2 years ago by francis jaTips3 comments – viewed 24,038 times – ( +5 ) – version 1.1
When we use multiple radio buttons with same name in Yii many people have the problem on getting the value of the selected radiobutton. The radioButtonList can be used for that, but if we need to use radioButton itself to place the button any where in a view, we need to include one more parameter in htmloption array().