0

I usually have the assets (css, js) in my /app/Resources folder, cause they are parsed with assetic. I now installed the ivoryckeditorBundle and thats a standalone bundle with a public folder in /vendor/egeloen/ckeditor-bundle/Resources/public where the assets are located. The bundle searches for the assets in /bundles/ivoryckeditor on my server. That should be in /web, but of course there is nothing to find yet.

What should I do now? Copy the public folder to /web? Or make a symlink from /web to the public folder? Or what other/better/cleaner ways are there to tell Symfony where to find the bundle assets?

Asara
  • 2,791
  • 3
  • 26
  • 55
  • 2
    Just try to run command ```php app/console assets:install``` it will create symlinks or copy the contents of assets in the bundle to your web directory. Also try to read more about that at http://stackoverflow.com/questions/22873164/difference-between-asseticdump-and-assetsinstall – sanis Jul 31 '16 at 09:10
  • Thanks. That means, the installer also uses one of my mentioned methods, but in a automated way, thats fine :) by the way, I used `assets:install --symlink --relative` because I think its much better than hardcopies, following [this](https://symfony.com/blog/new-in-symfony-2-6-smarter-assets-install-command) assets:install should do it by its own, but it used hardcopies without the symlink-option – Asara Jul 31 '16 at 09:30
  • you can post it as answer and I will vote it as solution – Asara Jul 31 '16 at 09:30

1 Answers1

4

Just run command php app/console assets:install and it will create symlinks or hard copies depending on --symlink flag.

It's the better way than using simple copy by hand.

sanis
  • 1,329
  • 1
  • 10
  • 11
  • isnt it even better to always use the --relative? I dont see any benefit in absolute linking – Asara Jul 31 '16 at 09:39
  • 1
    I would say symlink is good for development mode only, it's better way to use hard copies on production environment because of caching engines. Also symlinking with relative path could cause problems when you move your file from one place your web directory from one place to another, but that's a really rare case, but I have met it once on one old like world project. In my case I try to use symlinks only when working on local machine, but never on production, because I use minimizers on my assets. – sanis Jul 31 '16 at 09:43