Showing 521-540 of 827 items.

Dynamic parent and child CGridView on single view. Using $.ajax to update child gridview via controller, after row in parent gridview was clicked.

Created 14 years ago by Gerhard Liebenberg Gerhard Liebenberg, updated 12 years ago by Gerhard Liebenberg Gerhard Liebenberg. 20 comments

Many desktop programmers are used to having dynamic forms, where clicking on a record in a parent sub-form, updates another sub-form with the child records. While having many levels of nested sub-forms in a single view might not be such a good idea for a web application, I thought doing it one level deep might be interesting and useful. But, instead of sub-forms I used CGridViews.

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 680 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 753 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 138 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 957 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 447 times
Version: 1.1
Category: How-tos