Showing 81-100 of 163 items.

Adding 'disabled' to CCheckBoxColumn and support for yiigridview.js

Created 13 years ago by Xgamer99 Xgamer99, updated 13 years ago by Maurizio Domba Cerin Maurizio Domba Cerin. 3 comments

I recently had to have a checkbox column in my grid view that supported the 'disabled' attribute. This was easy enough to do by extending the CCheckBoxColumn. However, I also wanted the checkbox to be selected when clicking on the table's row (supported via CGridView's selectableRows option). I discovered I had to tweak yiigridview.js so that it would not select disabled rows when clicking on it o...

1 0
7
Viewed: 25 112 times
Version: 1.1
Category: Tips

Making friends' configs, DB credentials and paths with version control

Created 13 years ago by Alexander Palamarchuk Alexander Palamarchuk, updated 13 years ago by ajsharma ajsharma. 1 comment

In many cases developers of one project use their own local environments for coding. There may be a common test platform and, of course, production. All these environments usually have different DB credentials and directory structures (first of all, path to YII framework directory). Another feature is debugging. It's convenient to turn it on for local environments, eventually - on the test s...

1 1
4
Viewed: 21 349 times
Version: 1.1
Category: Tips

An important tip when you are using CArrayDataProvider.

Created 13 years ago by sirin k sirin k, updated 9 years ago by Maurizio Domba Cerin Maurizio Domba Cerin. 0 comments

Yii's CArrayDataProvider is very helpful to display model relation data's directly on it.But it is truely a confusing one because by default it will assume a table field named “id” as primary key for its pagination purpose and what if you dont have field named “id” as primary key on your table? so its truely confusing and if you tried to display without an “id” field on ur table you will get an...

5 1
5
Viewed: 23 013 times
Version: 1.1
Category: Tips

Solution for session lose of Facebook iframe application in Internet Explorer .

Created 13 years ago by sirin k sirin k, updated 9 years ago by Maurizio Domba Cerin Maurizio Domba Cerin. 0 comments

Facebook iframe app’s session is losing in Internet Explorer when doing a second redirection inside the facebook iframe app.The main reason is ,by default IE wont allow cookies in its priavacy settings If cookies not available means session is also not available for our Facebook iframe app in IE.

2 0
4
Viewed: 17 717 times
Version: 1.1
Category: Tips

Get notified about the status of a Facebook user in your web app using periodic Ajax calls.

Created 13 years ago by sirin k sirin k, updated 9 years ago by Maurizio Domba Cerin Maurizio Domba Cerin. 0 comments

hello,

 This article is helpful only if you have the following situation:
 A web app which uses facebook login to login its users and if a user is logged out from his/her facebook account through another browser tab, then your app dont know that he is logged out  out or not from his facebook account and he/she will remain as logged in your web application.Its ok if you have no problem wi...
4 0
6
Viewed: 19 613 times
Version: 1.1
Category: Tips

Custom Archive in Blog system

Created 13 years ago by nirmalroka nirmalroka, updated 13 years ago by nirmalroka nirmalroka. 0 comments

Hi I had made simple archive system for blog system that can handle tbl_post. I had used simple CDbCriteria not more than that. I know there is more and many better way to this but I think this will give some idea to users to generate new idea or customized or modified this version of code.

1 0
2
Viewed: 13 072 times
Version: 1.1
Category: Tips

Using sub query for doubletts

Created 14 years ago by mb mb, updated 13 years ago by mb mb. 3 comments

find doubletts by db fields. in this example i will check doublets for 3 tabelfields (col1,col2,col3). so i will get a subquery with the condition, select and grouping of the tablefields. the having with COUNT() > 1 means: find all records more then one result.

$model=new MyModel('search');
$model->unsetAttributes();

3 0
10
Viewed: 28 411 times
Version: 1.1
Category: Tips

Yii behind a reverse proxy, SSL support and correct IP logging

Created 14 years ago by mrkmg mrkmg, updated 14 years ago by mrkmg mrkmg. 0 comments

If you are hosting Yii behind a reverse proxy, for example nginx, and you are having issues with your logs showing the proxies IP, or the urls being created arn't being created for SSL because your SSL certs are located on your reverse proxy instead of the Yii server, this code may be able to help you. I placed them in the very top of Yii's entry script, index.php

0 0
2
Viewed: 21 311 times
Version: 1.1
Category: Tips

How to upload image(photo), and path entry in database with update functionality

Created 14 years ago by kiran sharma kiran sharma, updated 12 years ago by Shahcheraghean Shahcheraghean. 22 comments

I saw many posts that community newbie is confuse in image/photo upload with random name. so I post this topic covering all useful things regarding to image/photo upload(not covering image attribute related functionality)

15 0
39
Viewed: 217 969 times
Version: 1.1
Category: Tips

Access log output from unit tests

Created 14 years ago by Mike Mike, updated 14 years ago by Mike Mike. 2 comments

Say, you want to write a test for a component which provides a caching feature. How would you know, that some method of your component returns a cached result? With the solution described here you can inspect all log outputs. So you could search the logs for accesses to the DB to really make sure, that the result was served from cache.

3 0
2
Viewed: 18 936 times
Version: 1.1
Category: Tips

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 773 times
Version: 1.1
Category: Tips