Nickbartlett - nickbartlett.com - Nick Bartlett

Latest News:

How to add buttons to CGridView when using CArrayDataProvider 9 Aug 2013 | 07:02 pm

By default, the button’s used by CGridView expect an array of objects having an “id” property that it can use with the edit and delete buttons. If you’re using CArrayDataProvider, this won’t work. I w...

Join multiple tables with Yii CActiveRecord 7 Aug 2013 | 09:21 pm

I wanted to select records from a table using an attribute in one of the relations, which meant the underlying query would need to join two tables. I initially tried this The above does not work. The...

How to pre select radioButtonListRow and checkboxListRow with Yii 18 Jul 2013 | 07:25 pm

Looking at the code in Yii for radioButtonListRow and checkboxListRow it’s not apparent how to preselect these form elements with previously selected data. The solution is to set the model’s property...

Adding a confirm delete popup to Yii admin form 21 May 2013 | 12:55 am

I wanted to share this bit I was able to get working today with my Yii application. Add the JavaScript confirm dialog to the “htmlOptions” array key as below - ...

Using maxmind geo city lite database on your website 18 Mar 2013 | 07:59 pm

I’ve been using the maxmind geo city lite data for a couple years now and wanted to share what I’ve learned. Firstly, there is a great article here about constructing ...

Enable slow query log for cpanel whm 9 Feb 2013 | 10:49 pm

To enable the slow query log for your whm / cpanel server, do the following: open /etc/my.cnf with your favorite editor and add the following lines under the [mysqld] section: ...

MySQL – indexes on unique data can slow down your query 9 Feb 2013 | 02:18 am

Today I was running a query that joined two tables with one table having 1.9 million records and the other 340K. I had put an index on two columns that ...

Zend_Cache_Core is missing the setCacheDir method 3 Feb 2013 | 01:54 am

This seems to be troubling a lot of people, so after debugging Zend’s code, I’ll post the solution on how to change the cache directory of zend_cache. I’m using the ...

Enter key fires click event on form submit button 25 Jan 2013 | 10:48 pm

I ran into an odd situation today where pressing the enter key in a form would submit the form as if I’d clicked the submit button. I captured the event ...

How to find modified files for an author with Git 25 Jan 2013 | 12:42 am

The below command will display a list of files that have been added, modified, or renamed for the author you specify and the range of revisions you specify. git diff ...

Recently parsed news:

Recent searches: