Sorted by commentsX
Displaying 311-320 of 761 result(s).

Multiple CGridView virtual attributes, retrieved from a single model function. Also communication between CGridView columns and rows; and between CGridView and its own parent view.

Created 8 months ago by Gerhard LiebenbergHow-tos3 comments – viewed 3,377 times – ( +1 ) – version 1.1
We probably have all used a virtual attribute (model function) to retrieve complex or related data for a CGridView column:

Secure password hashing with bCrypt

Created 3 years ago by waitforitHow-tos3 comments – viewed 21,401 times – ( +9 ) – version 1.1
In this article I will show you how to implement a secure password hashing mechanism in your Yii projects using a bCrypt class.

Simple way to implement Dynamic Tabular Inputs

Created 8 months ago by ezekielnoobTutorials3 comments – viewed 6,597 times – ( +4 ) – version all

Drop down list with enum values for column of type ENUM >+> incorporate into giix

Created 3 years ago by c@cbaHow-tos3 comments – viewed 30,146 times – ( +14 ) – version 1.1
Let's say our table 'mug' has a column named 'color' of the type ENUM('red','green','blue'). We want to replace the textfield for the attribute color in the create and update forms of a 'mug' with a drop down list, which has the enum values as options. The main code was contributed by zaccaria in the forum (see this post).

Load data from internal/external source to fill form fields

Created 6 months ago by skwordenHow-tos3 comments – viewed 5,838 times – ( +1 ) – version 2.0
This wiki is to show you how to use jQuery get and JSON to get data from a dropdown/any form field and fill form fields with the values instantaneously. First, I'll give example use cases of what I'm going to teach you so you can quickly see if this is for you.

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

Created 3 years ago by c@cbaHow-tos3 comments – viewed 11,022 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 6 years ago by ricardogranaTutorials3 comments – viewed 11,229 times – ( +7 ) – version 1.1
This method was inspirated on the excellent text about different environments available at
tags: module

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

Created 2 years ago by Gerhard LiebenbergHow-tos3 comments – viewed 16,346 times – ( +8 / -1 ) – version 1.1
Countries sometimes change their laws pertaining to timezones and daylight saving times. This means that GMT+2 can be a different time this August compared to last August! However, by using php's DateTime class (instead of timestamps), we can do both "format" and "timezone" 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 current and historical timezones and daylight saving times.

SQL Logging and Profiling in FireBug (Yii 1.1)

Created 5 years ago by mindplayTutorials3 comments – viewed 22,995 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 3 years ago by c@cbaTutorials3 comments – viewed 51,572 times – ( +28 / -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...