Showing 281-300 of 373 items.

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

Created 14 years ago by c@cba c@cba, updated 14 years ago by c@cba c@cba. 3 comments

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.

9 0
9
Viewed: 23 978 times
Version: 1.1
Category: How-tos

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

Created 14 years ago by c@cba c@cba, updated 12 years ago by nsanden nsanden. 4 comments

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](...

10 0
11
Viewed: 57 490 times
Version: 1.1
Category: How-tos

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

Created 14 years ago by c@cba c@cba, updated 14 years ago by c@cba c@cba. 0 comments

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.

4 0
1
Viewed: 23 387 times
Version: 1.1
Category: How-tos

How to write secure Yii1 applications

Created 14 years ago by François Gannaz François Gannaz, updated 5 years ago by François Gannaz François Gannaz. 22 comments
  • Validate the user input (see below for details).
  • Protect (escape) your application output according to context (see below for a few output types, mostly HTML and SQL).
  • Test your application in debug mode.
    Set the constant YII_DEBUG to true (by default, it is defined in index.php) and put alongside error_reporting(E_ALL);. Then errors and warnings will stop the execution an...
80 0
114
Viewed: 339 353 times
Version: 1.1
Category: How-tos

How to re enable logging during unit testing

Created 14 years ago by Asgaroth Asgaroth, updated 14 years ago by Asgaroth Asgaroth. 3 comments

Some of you have experienced the need to log some information while doing unit testing, due to the fact that the information given in the summary is just not enough, to know why the test is actually failing. this article focuses on 2 ways to get you logs up and running again.

11 0
10
Viewed: 29 028 times
Version: 1.1
Category: How-tos