Wiki

Articles in category "tips", sorted by date (updated)X
Displaying 51-60 of 122 result(s).

Setting static modules' properties in config

Updated about a year ago by Alexander PalamarchukTips0 comments – viewed 4,494 times – ( +2 / -2 ) – version 1.1
You may face a situation when you need to access to a configurable module's property from everywhere and you don't have an instance of this module's class.
tags: config, module

[pt-br] O guia de estudos do Yii para iniciantes

Updated about a year ago by Rodrigo CoelhoTips0 comments – viewed 5,064 times – ( +1 ) – version 1.1
You can find the english version of this wiki here: The complete beginner's study guide for the Yii Framework.

mysql performance tip

Updated about a year ago by sirin kTips6 comments – viewed 6,392 times – ( +2 / -1 ) – version 1.1
When we are doing an insert of huge no.of rows into an SQL table ,Normally we will try to write separate insert quries this may lead us to a long duration of execution time and we can increase the speed of executing SQL quries by adding all the rows into a single insert query.
tags: mysql

An important tip when you are using CArrayDataProvider.

Updated about a year ago by sirin kTips0 comments – viewed 6,391 times – ( +7 / -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”.

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

Updated about a year ago by sirin kTips0 comments – viewed 4,797 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.

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

Updated about a year ago by sirin kTips0 comments – viewed 4,504 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

Custom Archive in Blog system

Updated about a year ago by nirmalrokaTips0 comments – viewed 3,355 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.

Customize CGridView columns directly in your view

Updated about a year ago by clapasTips4 comments – viewed 17,423 times – ( +2 / -2 ) – version 1.1
You usually take a model instance passed into your view to provide data to a CGridView in this way:

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

Updated about a year ago by mrkmgTips0 comments – viewed 3,708 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

How to filter CGridView with From Date and To Date datepicker

Updated about a year ago by kiran sharmaTips12 comments – viewed 24,639 times – ( +14 / -3 ) – version 1.1
This artical is related to allow user to filter CGridView with date range using datepicker on submit button. Here I use Yii Cookie to preserve date in datepicker textbox after submitting the form.