yii - customize the error message of a validation rule

Validators extending from CValidator all have a property named message. You can set this property in the corresponding validation rule to ...

yii - register client script adding javascript & css file in view example

Yii have CClientScript package which supports us register client script like javascript and css file in view. For better performance, we s...

Yii migration insert data to table

To insert data into any table using yii migration. You can use insert method of CDbMigration class. For example, I have table called ...

List of mysql column type declaration in Yii migration

Yii supports database migration via the yiic migrate command line tool. This tool supports creating new migrations, applying/reverting/redoi...

Yii framework - CHtml::link() example

In this post, i try to make some spaghetti code for Yii Chtml::link() method, to get familiar with Yii Chtml::link() fast. It's may be...

Check if an element is exists in array

To check if an element is exists in array , we use  in_array function: bool in_array ( mixed $needle , array $haystack [, bool $strict =...

yii Framework - calling model class from another module

Found a question from Yii framework forum. It's a bit late to answer, copy here and save my solution. I have 3 modules in my applica...

Multiple Database connection in Yii framework

Some ways to use multiple database connection in Yii framework. 1. Declare more database Connection in config file To use multiple databa...

Enable node revision Drupal

Drupal lets you create a new revision every time a node is updated. It allows you to track how the node has changed over time on your site.T...

[2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock)

I tried Yii Framework migration by using yiic in console. when yiic migrate database, it try to connect to db following the information that...