更新时间:2021-07-14 22:46:03
尝试
$icon = new Image('%kernel.root_dir%/appassBundle/Resources/Images/icon.png', 'icon');
或者也许:
$iconPath = $this->get('kernel')->getRootDir().'/appassBundle/Resources/Images/icon.png';
$icon = new Image($iconPath, 'icon');
类似,我看不到您项目的整个结构.
Or similar, I don't see whole structure of your project.