Wiki

Articles in category "tips", sorted by viewsX
Displaying 131-140 of 154 result(s).

an easy way to required multi columns(At least one cannot be blank)

Created 6 years ago by 1065227709Tips0 comments – viewed 7,655 times – ( +2 / -1 ) – version 1.1
in model add the following code:
tags: rules

Search a file size range in CGridView

Created 4 years ago by CrazyCatTips0 comments – viewed 7,579 times – ( +2 / -1 )
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".

Patching PHP code (used as a library) without changing the original code!

Created 4 years ago by le_topTips0 comments – viewed 7,365 times – ( +5 / -1 ) – version 1.1
The article Fixing extensions without modifying their code reminded me of another patching technique that I used. My conviction and a hard look on the web had led me to an article Redefine PHP class methods or class giving me a head start to do what I wanted: patching third party code without touching the original to allow easy upgrades.
tags: patch, patching

Customize your Growl/Alert msg easy and quickly

Created 2 years ago by Scott_HuangTips0 comments – viewed 7,284 times – ( +3 / -2 ) – version 2.0
I leverage Kartik's notification widgets.

How to preload dropdowns in CForm

Created 4 years ago by transistorTips0 comments – viewed 7,243 times – ( +1 / -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.

Inline views, write less

Created 4 years ago by FirebreakerTips0 comments – viewed 7,123 times – ( +3 / -1 )
Sometimes writing views like

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

Created 5 years ago by mrkmgTips0 comments – viewed 7,110 times – ( -1 ) – 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

Yii Rights Management Tips

Created 3 years ago by Rajith RTips0 comments – viewed 7,089 times – ( +6 / -1 ) – version 1.1
yii rights some tips..

Using Nginx and Apache2 in separate distributed servers (ie, Amazon EC2 instances)

Created 4 years ago by Luis Lobo BorobiaTips0 comments – viewed 7,003 times – ( +2 / -1 ) – version all
We are running one frontend running NGINX and several app servers running Apache2. There are several issues we have come across but right now I'll be documenting one of them. I'll be completing this article when I get more time.

Set a menu - reusable code

Created 4 years ago by Kostas Apazidis (KonApaz)Tips0 comments – viewed 7,002 times – ( +2 / -1 )
As we know Using crud generator creates menu items in view files (for each view file have a varius menu items)