Call Undefined Function

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



function getUser() {…}






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)