Search code examples
phpsymfonyasseticphp-5.6

Symfony Assetic is not linking own bundles


I found something that I can't explain why symfony behaves like this. I created several bundles to brake down the funktionality of my script to modules. Everything works fine so far. Today I deployed it for the first time to an staging environment. I executed

php app/console assetic:dump

without any issues. I then executes

php app/console assets:install web

but it didn't create symlinks for my own bundles. (Own my dev system they are there).

Here's the output:

php app/console assets:install
Installing assets as hard copies.
Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
Installing assets for Stfalcon\Bundle\TinymceBundle into web/bundles/stfalcontinymce
Installing assets for JMS\JobQueueBundle into web/bundles/jmsjobqueue

None of my bundles appear here. I am wondering how I can enable this, because I need to push also several images that belong to bundles with it.

I created the bundles using

php app/console generate:bundle

and controller skeletons

php app/console generate:controller

I did not modify any of the structure. (I am using anotation in the controller files and yml as config files) What am I missing? Didn't really have any look on searching in google as I don't really know where the problems are coming from. Or is it even an problem? Are there any folders missing?


Solution

  • Your bundles need to be added into

    assetic:
        bundles:[yourBundle]
    

    assetic expects your files in

    Bundle/Resources/assets 
    

    and/or

    Bundle/Resources/public
    

    folders.

    (I found this answer before a while, maybe it can be usefull to you to..)