By default, Yii uses the 'db' component for the interaction between your model and database. But Yii also supports multiple database connections. To use multiple database connections requires come configuration. In this blog I will explain how to configure multiple databases, preparing your models and use gii for creating models from all databases.

Earlier I explained how you can use X-SendFile to serve large static files more efficiently using PHP and Apache. Serving the files with PHP (and Yii) is really easy and I will explain how to do this after the break.

Yii comes with bucket of validators including a unique validator which validates whether an attribute value is unique in the corresponding database table. But what if your database unique constraint contains more than one attribute?

Ever served large files with PHP? I bet you loved that! Do not worry, I have good news for you! There is a solution (or improvement, whatever you want to call it) to the old way of serving files, which used to look sort of like this: