This Laravel4 package adds a view-helper
Install it via Composer by adding the following to your
composer.json-file (the asterix can be changed to an exact version):
NOTE: if you get this error:
zendframework/zend-http dev-master requires zendframework/zend-stdlib dev-master -> no matching package found., you might have got this error..
...and add the following to the
providers-array in your
The config-file is self-explanatory:
To change some of the settings, simply just run (as always)
php artisan config:publish jboysen/laravel-gcc
This helper will:
- Lookup the files given as argument to the helper.
- Create a unique filename for the compiled files based on the filenames and the last modification time of the files.
- Compile the bundle (if it's not present).
- Output a script-tag linking to the compiled file.
As compilation of several files sometimes can take time, it is better to do this "offline", that is before any users hit the web application.
php artisan gcc:build
This command will scan all files in the
/app/views-directory and find all uses of the view-helper described above, and
compile the bundles immediately, making sure the users won't experience any long response times.
Remove all files from the
/app/storage/laravel-gcc-folder. This task might be useful in deployment-procedures.