Showing 41-60 of 120 items.

An important tip when you are using CArrayDataProvider.

Created 14 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 103 times
Version: 1.1
Category: Tips

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

Created 14 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 817 times
Version: 1.1
Category: Tips

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

Created 14 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 713 times
Version: 1.1
Category: Tips

Custom Archive in Blog system

Created 14 years ago by nirmalroka nirmalroka, updated 14 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 160 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 480 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 360 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: 218 130 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: 19 000 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 886 times
Version: 1.1
Category: Tips