Wiki

Articles in category "how-tos"X
Displaying 91-100 of 182 result(s).

CGridView keep focus on the control after filtering

Created about a year ago by jayalaHow-tos0 comments – viewed 5,095 times – ( +4 )
You can find the reason why I wrote this article here.
tags: CGridView, filter

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

Created about a year ago by c@cbaHow-tos2 comments – viewed 5,362 times – ( +9 )
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.

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

Created about a year ago by c@cbaHow-tos2 comments – viewed 12,536 times – ( +11 )
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).

How to obtain a grammatically correct translation of the model name in giix-generated view files

Created about a year ago by c@cbaHow-tos0 comments – viewed 4,932 times – ( +4 )
The giix code generator has out of the box i18n support for model names and attribute labels (besides other cool features > check it out!) . But I want to factor in not only the plural form, but also the grammatical cases (especially the accusative) while translating 'Manage Objects', 'Create Object', 'Edit Object' etc.

History Autocomplete

Created about a year ago by zaccariaHow-tos2 comments – viewed 5,474 times – ( +3 )
In application development we often have to choose how to mange recurrent values.
tags: autocomplete

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

Created about a year ago by jpabloHow-tos2 comments – viewed 6,218 times – ( +1 )
Yii i18n does not cover decimal format. Some languages like Spanish (I live in Argentina) uses comma ',' instead of dot '.' as decimal separator.

Tarpit for bad bots

Created about a year ago by mitherealHow-tos4 comments – viewed 3,791 times – ( +1 )
I recently built a tarpit for bad bots.
tags: tarpit, bots

Database driven Cmenu

Created about a year ago by twisted1919How-tos1 comment – viewed 10,666 times – ( +12 )
This is a simple example that will give you a base for designing a database driven menu system that will use CMenu to be rendered.

Secure password hashing with bCrypt

Created about a year ago by waitforitHow-tos3 comments – viewed 11,027 times – ( +6 )
In this article I will show you how to implement a secure password hashing mechanism in your Yii projects using a bCrypt class.

Accessing data in a join table with the related models

Created about a year ago by fsbHow-tos7 comments – viewed 35,892 times – ( +18 / -1 )
Sometimes the right place to store application data is in a join table. For example, movie viewers either like or don’t like the movies they watched.