Wiki

Articles in category "tips", sorted by viewsX
Displaying 91-99 of 99 result(s).

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

Created 9 months ago by mrkmgTips0 comments – viewed 2,629 times
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

CjuiDatepicker

Created 2 months ago by hiral darjiTips0 comments – viewed 2,541 times – ( +2 )
If you have two datepicker in one form and you want that a date of from date shold be minimum date of todate then put following code in Cjuidatepicker widget options array:

CGridView: Adding behaviors from configuration, and template items from behaviors to CGridView

Created about a month ago by le_topTips0 comments – viewed 2,375 times – ( +4 )
Changing the way a CGridView is rendered from the configuration file, or through behaviors specified at the moment it is used, is handy to extend a CGridView without creating tons of different classes for it. I am surprised that this is not in the default implementation, so I made my default CGridView implementation.

using jqbargraph to create beautiful graphs

Created 2 months ago by MAHESH.E.UTips0 comments – viewed 2,366 times – ( +5 )
If you are about to create a graph, the best option i would suggest is the jqbargraph.

Custom Archive in Blog system

Created 9 months ago by nirmalrokaTips0 comments – viewed 2,258 times – ( +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.

Fixing extensions without modifying their code

Created 2 months ago by schmunkTips3 comments – viewed 2,184 times – ( +5 )
If you're working a lot with extensions you often stumble upon problems, when you want to include them into your custom web application, like hardcoded or absolute path aliases or classes extended from core application components, which implement addiditonal features.

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

Created 2 months ago by le_topTips0 comments – viewed 1,756 times – ( +3 )
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

Using CListView to display items next to each other (in columns)

Created a day ago by thyseusTips0 comments – viewed 748 times – ( +1 )
When using CListView to display multiple views next to each other, we can use the $index variable inside the viewFile to achieve this. As far as i know there is no extension or out-of-the-box functionality for this, so we need to apply a little hack:

Debugging CActiveRecord failed save() attempts

Created 2 days ago by BoazTips0 comments – viewed 660 times – ( +4 )
When you're filling up a form of a CActiveRecord (using CActiveForm for example), usually you'll construct your code so that in case of validation error you'll get back the form with the error displayed back to you, typically when CActiveForm.errorSummary() is used. This is how its done by Gii.