如何访问 symfony 包的 public 文件夹

how to access public folder of symfony bundle

我的 /app/Resources 文件夹中通常有资产 (css, js),因为它们是用资产解析的。我现在安装了 ivoryckeditorBundle,这是一个独立的捆绑包,在资产所在的 /vendor/egeloen/ckeditor-bundle/Resources/public 中有一个 public 文件夹。该捆绑包在我的服务器上搜索 /bundles/ivoryckeditor 中的资产。那应该在 /web 中,但当然还没有找到任何东西。

我现在该怎么办?将 public 文件夹复制到 /web?或者创建一个从 /web 到 public 文件夹的符号链接?或者有什么 other/better/cleaner 方法告诉 Symfony 在哪里可以找到捆绑资源?

只需运行命令php app/console assets:install,它将根据--symlink标志创建符号链接或硬拷贝。

这是比手动简单复制更好的方法。