dsfsdfsd34324 2014-07-16 08:21
浏览 28

使Yii隐式使用类

I have a 3rd party library that I import this way:

Yii::setPathOfAlias('Payum', dirname(__FILE__).'/../extensions/PayumYiiExtension/vendor');
Yii::import('Payum.autoload', true); // <--- note that this is Composer's autoload class

Now, everything is working as expected if I write some explicit use lines:

use Buzz\Client\Curl;
use Payum\Core\Extension\StorageExtension;
use Payum\Core\Storage\FilesystemStorage;
use ...

But I'm wondering if there is any way to make Yii auto-load/use those classes when they are used, instead of having to write all those use lines myself.

  • 写回答

0条回答 默认 最新

    报告相同问题?