Yii – User defined rules for Access rights

A key part of a web application is access security. Who can see what data, who can do what actions… Continue reading

January 24th, 2012

Replace Windows Shell

If you’re like me and like the bash interface on linux then here is a really quick and easy way to replace the windows shell with a linux based bash interface. http://stackoverflow.com/a/4144747/1145818

January 20th, 2012

Yii – Relations using a non-primary key

Often mistakes you make in your database design stage come around and bite you in the butt later! My Mistake I’m just testing a new reservation system that should be going live soon and it’s looking really good, expected results … Continue reading

January 19th, 2012

Yii – Further model validation

UPDATED 26-Jan-2012 ! A brief note today to add some more specific validation to your models.  As we all know – “rubbish in == rubbish out”, so let’s get that data nice and clean, right up front!  PHP |  copy code |? 01public function rules()02 … Continue reading

January 17th, 2012

Yii – How to customize a CGridView CbuttonColumn

Update – Delete – View I’m sure you’ve already seen and used the basic buttons in a CGridView and maybe even used the template phrases to modify the behaviours  PHP |  copy code |? 01array(02 ‘class’=>’CButtonColumn’,03 ‘template’=>’{delete}{update}’,04 ‘buttons’=>array(05 ‘update’=>array(06 ‘url’=>’$this->grid->controller->createUrl("/History/update", array("id"=>$data->primaryKey,"asDialog"=>1,"gridId"=>$this->grid->id))’,07 ‘click’=>’function(){$("#cru-frame").attr("src",$(this).attr("href")); $("#cru-dialog").dialog("open"); return false;}’,08 … Continue reading

January 12th, 2012

Yii – Converting MySql dates to locale dates

It seems strange to me that two systems that have been around for so long and worked so closely together, do not manipulate dates in the same way. It is also so easy to waste hours of time trying to … Continue reading

January 7th, 2012

Disable Yii logging

The Yii logging system is fantastic.  A truly versatile system where you can output trace messages to one route and warning messages to another. One of the options adds an HTML table to the bottom of the current page with … Continue reading

December 28th, 2011

Configuring Yii with additional modules

I got a bit confused initially when I tried to add the excellent User module into my first webapp. It all came down to the config/main.php and adding the extra parameters into the right place. So for all you other … Continue reading

December 17th, 2011

Yii: How to make a dynamic sub-menu – UPDATE

In a previous article (How to make a dynamic Sub-menu I discussed a technique to allow you to build a dropdown sub-menu system where each sub-menu is populated by the controller. I have updated my menu system as I wanted … Continue reading

December 17th, 2011

Yii: How to make a dynamic sub-menu

I’ve seen a number of people have been trying to build a dynamic submenu that sits underneath the main menu and changes with each main menu. The standard Yii menu widget assumes or enforces the hard-coding of menu entries within … Continue reading

December 16th, 2011