Wiki

Articles in category "how-tos", sorted by commentsX
Displaying 101-110 of 189 result(s).

File uploads in CForm (Form builder)

Created about a year ago by Luke JurgsHow-tos2 comments – viewed 21,832 times – ( +8 )
While there is a reasonable amount of documentation regarding CForm (form builder) and file uploads seperately, there really is not any coverage of both in combination.

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

Created about a year ago by jpabloHow-tos2 comments – viewed 6,591 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.

History Autocomplete

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

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 13,291 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 extend CFormatter, add i18n support to booleanFormat and use it in CDetailView

Created about a year ago by c@cbaHow-tos2 comments – viewed 5,658 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.

AssetManager: clearing browser's cache on site update

Created about a year ago by dhampikHow-tos2 comments – viewed 12,864 times – ( +14 )
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.

How to hide `index` action from URL

Created 12 months ago by rootbearHow-tos2 comments – viewed 6,598 times – ( +3 / -2 )
Here is my experiment inspired by my own question and others from the forum.
tags: index

Using recaptchlib in your projects

Created 2 years ago by Antonio RamirezHow-tos2 comments – viewed 5,452 times – ( +5 )
It is good when someone writes extensions for us but trust, sometimes we forget about other approaches that, if we know the library, we shouldn't forget.

Setting and getting systemwide static parameters

Created 2 years ago by Steve FriedlHow-tos2 comments – viewed 31,089 times – ( +10 )
Occasionally one wishes to set systemwide parameters for an application, such as a contact address for email, an application name, or setting an option that guides major behavior. Yii provides for setting of static parameters in the configuration file, and this article talks about how to do it conveniently.
tags: config

How to "masquerade" a non-required form element as 'required' one (in the view only)

Created 9 months ago by BoazHow-tos2 comments – viewed 3,597 times – ( +5 / -1 )
In a nutshell, the task at hand is to mark (or render) a model attribute in the typical "_form.php" view file with the 'required' red asterisk while this attribute is not marked as required in the model's rule() method. If you're interested only in the solution, jump ahead to the 'solution' section below.