Wiki

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

How to use a component before every action of a controller

Created 3 years ago by transistorTips1 comment – viewed 32,113 times – ( +3 / -1 ) – version 1.1
I guess this is a tip on how to execute some code before every action in a controller, because I will tell you how I did it and maybe you can use the idea in your project.

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

Created 2 years ago by le_topTips0 comments – viewed 3,759 times – ( +1 ) – version 1.1
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.

Analyse the server's USER-AGENT against browsecap file to determine it's capability.

Created 2 years ago by Deepak PradhanTips0 comments – viewed 2,915 times – version 2.0
Does your application need to know user's details on browser details, os and device type? We can use PHP's misc. function to achieve that provided you have an update copy of browsercap.ini

Yii Rights Management Tips

Created 2 years ago by Rajith RTips0 comments – viewed 5,570 times – ( +6 ) – version 1.1
yii rights some tips..

Search a file size range in CGridView

Created 3 years ago by CrazyCatTips0 comments – viewed 6,139 times – ( +2 )
Working on a report system of files transfert, I had to let the users simply find files by size. I didn't want to have two fields, I prefer a simple text input, with "human syntax".

Understanding series articles

Created 5 years ago by GOshaTips0 comments – viewed 9,436 times – ( +16 ) – version 1.1
Here are all wiki articles from "Understanding" series by Yii wiki contributors:

YII2 Pagination Options

Created about a year ago by VivekYiiTips0 comments – viewed 5,983 times – ( +1 ) – version 2.0
solution here If we are using default pagination option like
tags: pagination, View, vivs

Selecting best language based on Browser language and available languages.

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

How to preload dropdowns in CForm

Created 3 years ago by transistorTips0 comments – viewed 6,124 times – ( +1 )
So you want to use CForm (form builder), but need to preload dropdowns in a form? It's simpler than it seems. You got your CFormModel, CForm and the actual Form, right? Let's say you have the typical State -> City dependent dropdowns, so you would want to load the from with the State and City selected.

Things to Consider when application hosting on AppFog

Created about a year ago by VINAY Kr. SHARMATips0 comments – viewed 2,997 times – ( +1 ) – version 1.1
I faced many issues when hosted our company website on AppFog.