Order of impoorted classes

Hi guys!

I faced with one problem: I have application and admin for it as different yii applications. so folders structure is like




In my admin application I’ve imported some app’s modules that should be common for app and admin. When my yii was 1.0.7 all was great, but after update to 1.0.9 my admin app started to fail.

I’ve investigated the failure and the problem is with same name for LoginForm model. I would like to use in admin admin’s LoginForm, but it loads app’s LoginForm. Here’s my config:


$root = dirname(dirname(dirname(dirname(__FILE__))));

Yii::setPathOfAlias('client', $root . DIRECTORY_SEPARATOR . 'client' . DIRECTORY_SEPARATOR . 'protected');









*client - is name of my main app

Could I point to yii what particular LoginForm I would like to use?

In 1.0.8, the order of PHP include paths set via import statement is changed. In particular, the most recent (last) import statement takes precedence. So you should just switch the order of your import elements. You may also explicitly import a particular class using Yii::import(‘path.to.className’);

Thank you qiang, cheers!