Articles in Category: yii

UTF-8 in Yii

I recently got bogged down by a problem using UTF-8 in Yii. Perhaps, this is a general PHP problem rather than specific to the Yii Framework, but anyway documented for tohers to try

[more...]

Yii - User defined rules for Access rights

Yii Access Control Rules A key part of a web application is access security. Who can see what data, who can do what actions. Within Yii the first layer of access security is defined within the controller where access control rules are defined for each action

[more...]

Yii - CDbCriteria->compare as list

Sometimes you may want to restrict your a cgridview to only display records with a list of values. The CDbCriteria class reference page stipulates that the allowed values are: the column value to be compared with

[more...]

Yii access rules - isAdmin

In a previous article, User defined rules for Access rights, I described the basic access rules available in Yii. One area that often seems to confuse Yii developers is the Admin access restriction

[more...]

Yii - Updating a MySQL datetime column with now()

Just a quick tip which took me a little while to figure out. If you have a "last_updated" column on your table and you want to update this manually in your code ten the easiest way would be use the MySQL NOW() function Update some_table set last_updated_date=now(); However, and there is always a catch, if you try and use the now() function in a Yii prepared statement, it will try and update the column with the string "now()" and fail

[more...]