Showing 521-540 of 826 items.

Integrating Wordpress and Yii: still another approach, using Yii as the router/controller

Created 14 years ago by acorncom acorncom, updated 13 years ago by acorncom acorncom. 24 comments

When you're finished following this article, you'll have a website that integrates WordPress and Yii routes in under one path. For example, you can setup /widgets and /customers to point to Yii controllers and /about-us, /contact-us, /blog/* and /faq pointing to WordPress pages.

19 0
24
Viewed: 91 609 times
Version: 1.1
Category: How-tos

using multiple radio button

Created 14 years ago by francis ja francis ja, updated 12 years ago by Rohit Suthar Rohit Suthar. 4 comments

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

6 0
13
Viewed: 79 673 times
Version: 1.1
Category: Tips

CGridView: Use special variable $data in the htmlOptions of a column (i.e. evaluate htmlOptions attribute)

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

    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 `...

19 1
14
Viewed: 85 070 times
Version: 1.1
Category: Tutorials

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 897 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 353 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 322 times
Version: 1.1
Category: How-tos