1. прочитать этот файл в строку json;
2. получить из json-строки items-массив;
3. вернуть items-массив.
Вот содержимое jsonmy.php:
Код: Выделить всё
{"id":"1","text":"Root node","children":[{"id":"2","text":"Child node 1"},{"id":"3","text":"Child node 2"}]}
Код: Выделить всё
public function actionJsonmy()
{
$json = file_get_contents('jsonmy.php');
Yii::$app->response->format = Response::FORMAT_JSON;
$items = json_decode($json);
return $items;
}