Wiki

Articles in category "tips", sorted by commentsX
Displaying 101-110 of 134 result(s).

Reading the doc

Created 3 years ago by zaccariaTips0 comments – viewed 6,461 times – ( +21 ) – version 1.1
Almost all the information you need whilst working with yii is written in the Class Reference.
tags: doc

Extending CActiveForm for some form display fixes and language tweaks

Created 3 years ago by TrejderTips0 comments – viewed 12,622 times – ( +5 ) – version 1.1
In this simple example I'll demonstrate how to extend CActiveForm class to overload some drawing functions to achieve some commonly used fixes in forms.

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

Created 2 years ago by mrkmgTips0 comments – viewed 4,066 times – version 1.1
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

Custom Archive in Blog system

Created about a year ago by nirmalrokaTips0 comments – viewed 3,851 times – ( +2 ) – version 1.1
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.

ChromePHP for Yii

Created 3 years ago by imeheszTips0 comments – viewed 9,571 times – ( +2 / -2 ) – version 1.1
ChromePHP is a console logging extension for Google Chrome.

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

Created about a year ago by sirin kTips0 comments – viewed 5,000 times – ( +4 ) – version 1.1
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 with this situation.But if you want to forcefully logout the user from your application if he is logged out from his facebook account means you can try this example.This example uses periodic ajax calls to facebook's graph api to check whether the user is logged in or not.
tags: facebook, user

Extending common classes to allow better customization

Created 3 years ago by Steve FriedlTips0 comments – viewed 21,308 times – ( +42 ) – version 1.1
The two most commonly-used base classes in most Yii applications are CController and CActiveRecord, each extended to your own particular models and controllers.

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

Created about a year ago by sirin kTips0 comments – viewed 5,532 times – ( +2 ) – version 1.1
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.

An important tip when you are using CArrayDataProvider.

Created about a year ago by sirin kTips0 comments – viewed 7,407 times – ( +8 / -1 ) – version 1.1
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 error like “yourmodel.id is not defined”.

Auto-update denormalized attributes with MongoDb and Yii2

Created 5 months ago by edoardo849Tips0 comments – viewed 2,813 times – ( +1 ) – version 2.0
You have different collections in MongoDb with de-normalized attributes. As you may know, due to its not-join nature, MongoDb tends to encourage repetition of the same value in different collections (de-normalization). In this MongoDb is opposed to a more SQL-like approach where you usually reference only the ID of the value with a foreign key.