Wiki articles in category Tips

Showing 1-20 of 118 items.

Provide SVG when the browser supports it, else PNG (using CHtml::image overload)

Created 4 years ago by le_top, updated 4 years ago by le_top.

Modern browsers support SVG, older browsers do not. This replacement for CHtml::image() allows you to handle to propose SVG in an efficient way with PNG as a fallback.

1 0
1 follower
Viewed: 5 912 times
Version: 1.1
Category: Tips

Yii Rights Management Tips

Created 4 years ago by Rajith R, updated 4 years ago by Rajith R.

yii rights some tips..

2 0
4 followers
Viewed: 9 062 times
Version: 1.1
Category: Tips

Understanding series articles

Created 7 years ago by GOsha, updated 7 years ago by GOsha.

Here are all wiki articles from "Understanding" series by Yii wiki contributors:

16 0
13 followers
Viewed: 10 935 times
Version: 1.1
Category: Tips

Selecting best language based on Browser language and available languages.

Created 4 years ago by le_top, updated 4 years ago by le_top.

Your application is international and you have to select the best language for the user. Your user may have selected 'fr_CA' and you have 'fr_FR' or 'fr' available. What do you do? Here is a tip.

2 0
1 follower
Viewed: 9 449 times
Version: 1.1
Category: Tips

Things to Consider when application hosting on AppFog

Created 4 years ago by VINAY Kr. SHARMA, updated 4 years ago by VINAY Kr. SHARMA.

I faced many issues when hosted our company website on AppFog.

1 0
1 follower
Viewed: 5 160 times
Version: 1.1
Category: Tips
1 0
6 followers
Viewed: 22 193 times
Version: 1.1
Category: Tips

Multi Data Provider

Created 5 years ago by Sharon Lavie, updated 3 years ago by Sharon Lavie.

Lately, i needed to deal with the following scenario: read from two databases (db1,db2), and write to a third database (db3).

1 0
4 followers
Viewed: 12 226 times
Version: 1.1
Category: Tips

Yiistrap TbHtml::navbarSearchForm

Created 5 years ago by Patrice, updated 5 years ago by CeBe.

Hi all,

0 0
3 followers
Viewed: 12 093 times
Version: 1.1
Category: Tips

Reading the doc

Created 8 years ago by zaccaria, updated 8 years ago by Orteko.

Almost all the information you need whilst working with yii is written in the Class Reference.

21 0
3 followers
Viewed: 9 284 times
Version: 1.1
Category: Tips
Tags: doc

Extending CActiveForm for some form display fixes and language tweaks

Created 8 years ago by Trejder, updated 8 years ago by Trejder.

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.

The colon

Here is overloaded version of CActiveForm.labelEx that adds colon (:) at the end of text of label with respecting CHtml::$afterRequiredLabel and CHtml::$beforeRequiredLabel

5 0
6 followers
Viewed: 19 283 times
Version: 1.1
Category: Tips

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

Created 6 years ago by mrkmg, updated 6 years ago by mrkmg.

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 followers
Viewed: 9 927 times
Version: 1.1
Category: Tips

Custom Archive in Blog system

Created 6 years ago by nirmalroka, updated 6 years ago by nirmalroka.

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 followers
Viewed: 7 441 times
Version: 1.1
Category: Tips

ChromePHP for Yii

Created 8 years ago by imehesz, updated 8 years ago by imehesz.

ChromePHP is a console logging extension for Google Chrome.

3 1
4 followers
Viewed: 14 833 times
Version: 1.1
Category: Tips

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

Created 6 years ago by sirin k, updated 2 years ago by Maurizio Domba Cerin.

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 followers
Viewed: 9 745 times
Version: 1.1
Category: Tips
Tags: facebook, user

Extending common classes to allow better customization

Created 8 years ago by Steve Friedl, updated 8 years ago by Steve Friedl.

The two most commonly-used base classes in most Yii applications are CController and CActiveRecord, each extended to your own particular models and controllers.

36 0
19 followers
Viewed: 33 764 times
Version: 1.1
Category: Tips
Tags:

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

Created 6 years ago by sirin k, updated 2 years ago by Maurizio Domba Cerin.

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 followers
Viewed: 9 933 times
Version: 1.1
Category: Tips

An important tip when you are using CArrayDataProvider.

Created 6 years ago by sirin k, updated 2 years ago by Maurizio Domba Cerin.

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 followers
Viewed: 15 708 times
Version: 1.1
Category: Tips

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

Created 6 years ago by Rodrigo Coelho, updated 6 years ago by Rodrigo Coelho.

You can find the english version of this wiki here: The complete beginner's study guide for the Yii Framework.

1 0
3 followers
Viewed: 10 963 times
Version: 1.1
Category: Tips
Tags:

Setting static modules' properties in config

Created 6 years ago by Alexander Palamarchuk, updated 6 years ago by Alexander Palamarchuk.

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.

1 1
2 followers
Viewed: 11 163 times
Version: 1.1
Category: Tips
Tags: config, module

Speedup unit tests by moving MySql data to memory (in Ubuntu)

Created 6 years ago by seb, updated 6 years ago by François Gannaz.

There are several ways to speedup slow unit tests which interact with database:

1 1
3 followers
Viewed: 17 201 times
Version: 1.1
Category: Tips