Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Managing Assets
  • Hello everyone!

    I would like to know if you use something to manager their assets more automated.

    I found the bower.io and it seems to be interesting.

    Which techniques you guys use?

    Regards.
  • In our production we use grunt to automate file concatation, sass compilation, minification, file copy from bower. Once you learn it and write a solid grunt file once you never want to go back to not using automatization. I highly recommend learning/using it.

    Gulp is the new kid on the automatization block. This presentation compares them two nicely.


  • Currently it is quite hard to manage assets in fuel, since you need a full fuel instance which is quite unmaintainable. You cannot install a package eg. with composer and use it's assets. You have to copy them into the public directory.

    Possible solutions I tried (but none of them is 100%):

    Have an asset controller which catches the asset requests (assets/css/something) and returns the file from outside of the DOCROOT. (The URI is rewritten by apache rewrite module. If the file is found, then it will be returned, no rewrite is taken into action). Can work fine in development environment.

    Use Assetic, which can create a cache and use the temporary generated files. If one is not found, it will be generated for you.

    Have some install logic (eg. in case of themes). Install the required assets in the DOCROOT. You should also make sure, that some uninstall logic exists.


    I find bower/grunt a fine combo when creating a template, etc, but might be good in case of fuel as well.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion