I created 2 controllers in a Yii application: FirstController.php and SecondController.php in the default controller path.
FirstController.php:
<?php class FirstController extends Controller { public static function returnFunc() { return 'OK'; } }
SecondController.php:
<?php class SecondController extends Controller { public function exampleFunc() { $var = First::returnFunc(); } }
When I try to execute exampleFunc() in SecondController, Yii throws an error:
YiiBase::include(FirstController.php) [<a href='function.YiiBase-include'>function.YiiBase-include</a>]: failed to open stream: No such file or directory
Calling FirstController::returnFunc() does not work in the same way.
I am new to OOP and Yii. What is the problem?
oop php yii
ZhukovRA
source share