There is a file with a class and the Profile.php function:
<?php class News { public static function getNewsList() { $api = "123123123"; //Функция большая, это её начало. There is a file which, in theory, includes the code above:
<?php include_once ROOT. '/models/Profile.php'; class ProfileController { public function actionIndex() { $newsList = News::getNewsList(); echo $api; // Выдаёт ошибку:Notice: Undefined variable: api return true; } The function is connected, it is one hundred percent. But for some reason he does not see variables ... What is the problem?