Wiki

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

CButtonColumn and Font Awesome icons

Created 8 months ago by DerekCTips3 comments – viewed 7,252 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,036 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,275 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,663 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 6,955 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,720 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.

SQL Logging and Profiling in FireBug (Yii 1.1)

Created 4 years ago by mindplayTutorials3 comments – viewed 17,045 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,090 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 23,892 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().

Performance - A Guide For Best Practice

Created 4 years ago by Y!!Tutorials3 comments – viewed 14,193 times – ( +8 / -5 ) – version 1.1
In this guide I will explain best practise regarding performance in MySQL, PHP and of course our loved Yii Framework. Since this is a complex topic, I will start with some basics and then expand this guide from time to time. Since this wiki can become big, you may click on View history - there you can see what changes have been made, so you don't miss anything.
tags: performance