Wiki

Articles in category "tips", sorted by viewsX
Displaying 61-70 of 135 result(s).

CJuiTabs Content

Created about a year ago by mbalaTips2 comments – viewed 10,500 times – ( +6 ) – version 1.1
When I used CJuiTabs I did something. They are
tags: CJuiTabs

URL component access functions

Created 3 years ago by Steve FriedlTips1 comment – viewed 10,459 times – ( +28 ) – version 1.1
Many applications wish to obtain parts of the URL for the current page (the hostname, the query string, etc.), and the CHttpRequest class wraps various $_SERVER variables to break down the URL into its constituent parts.
tags: URL, request

Managing constants easily

Created 2 years ago by briiC.lvTips4 comments – viewed 10,324 times – ( +4 ) – version 1.1
For time to time i have models with constants (basicly status constants) which i use in diferent places and if these constant changes, i have to change mentions of constant in code elsewhere.

ChromePHP for Yii

Created 3 years ago by imeheszTips0 comments – viewed 9,677 times – ( +2 / -2 ) – version 1.1
ChromePHP is a console logging extension for Google Chrome.

Yii code completion and calltips in Komodo Edit

Created 3 years ago by viterTips1 comment – viewed 9,540 times – ( +6 ) – version 1.1
My favourite editor is Komodo Edit (free and crossplatform) and I use it for my everyday coding work. Just recently I found out how to make it help me to work with Yii. :) So follow these steps:
tags: Komodo Edit

Debugging CActiveRecord failed save() attempts

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

Adding 'disabled' to CCheckBoxColumn and support for yiigridview.js

Created about a year ago by Xgamer99Tips3 comments – viewed 9,113 times – ( +1 ) – version 1.1
I recently had to have a checkbox column in my grid view that supported the 'disabled' attribute. This was easy enough to do by extending the CCheckBoxColumn. However, I also wanted the checkbox to be selected when clicking on the table's row (supported via CGridView's selectableRows option). I discovered I had to tweak yiigridview.js so that it would not select disabled rows when clicking on it or on the 'select all' checkbox.

Getting nulls from database instead of empty strings

Created 3 years ago by samdarkTips2 comments – viewed 9,069 times – ( +13 ) – version 1.1
To get null from database instead of empty strings you need to set up your DB connection as follows:
tags: database, null

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

Created about a year ago by thyseusTips3 comments – viewed 8,780 times – ( +10 )
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:

Como trasponer una lista creada con CHtml::checkBoxList

Created 2 years ago by rdjteamTips3 comments – viewed 8,717 times – ( +2 ) – version 1.1
En ciertas ocasiones tenemos que lidiar con el tema de colocar una lista de checkboxes para hacer una seleccion especifica como es el caso de los dias de la semana para un calendario, para esta labor tenemos el comando CHtml::checkBoxList(), revisando un poco el funcionamiento de este temos los siguientes parametros: