Call Undefined Function

The function is defined in some php file. At the same time the php file is imported in config/main.php.

Example:

/protected/vendors/'some.php

function getUser() {…}

config/main.php

‘import’=>array(

‘application.models.*’,

‘application.vendors.*’,

),

But the error is happened when I call the function in another php file.

appreciate for your help.

Yii’s import feature was designed mainly for class autolading. It won’t include procedural PHP files automatically - you still have to do it manually.


Yii::import('application.vendor.some', true)

Thanks.