assetic

Assetic Add file located in app/Resources/js

半城伤御伤魂 提交于 2019-12-24 00:29:23
问题 I am creating a bundle that requires a 3rd party js file. According to the documentation: http://symfony.com/doc/current/cookbook/bundles/best_practices.html#vendors Bundles should not contain 3rd party code. Since the bundle is only used in one part of the site I dont want to include it in my base template file - I want to call it from the twig file, but I am running into a problem there. All of the demos for including js seem to reference a bundle name, but I have placed my js in app

Sass broken after install with RVM, using Assetic PHP

我的未来我决定 提交于 2019-12-23 19:21:50
问题 I'm trying to set up Assetic PHP asset compiler and I have got it working with CoffeeScript, Stylus, and Less (all the NPM packages worked perfectly). However, with Sass I am having a problem. Here are the steps I've taken so far: I installed RVM along with Ruby 1.9.3 and ran gem install sass . I ran which sass . This returned /home/jon/.rvm/gems/ruby-1.9.3-p0/bin/sass . I copied that location into SassFilter.php in Assetic where it says $sassPath = '' in the constructor function. This is the

In Symfony2 how can I append a date to the assetic filenames

妖精的绣舞 提交于 2019-12-22 12:36:24
问题 I'm using assetic with symfony and I'd like to append a timestamp or date string to the end of the filenames it creates. The purpose of this is to have more control over browser caching, so every time I run assetic:dump, all my compiled assets will have a new file name and users browsers will download the new file. Is this the best way to prevent browsers using old (cached) asset files? If it is, how do I append the timestamp to the filenames? 回答1: I suggest, in order to have control over

Static asset dumping with png optimization references wrong files

南笙酒味 提交于 2019-12-22 09:39:56
问题 I'm trying to build a project using Symfony2 and all possible optimizations included. One of such is the optimizing of images used in the html. Symfony2 has a bundle Assetic that allows for this using e.g. optipng right from the Twig templates. The docs are here: http://symfony.com/doc/2.0/cookbook/assetic/jpeg_optimize.html The problem i'm having is that everything works in the dev environment (where all assetic assets are served through a controller) but that the CLI command dumps to a file

Load one js file using assetic inside Symfony2

我们两清 提交于 2019-12-22 00:34:43
问题 I am new to Symfony 2. Previously I worked a lot with Codeigniter. Now that I am exploring assetic, I am not able to understand how I can add a single file to the stack of JS files which are already being loaded. I have a main page twig file which has something like this: {% javascripts '@BlogBlogBundle/Resources/public/js/vendor/*' output='js/combined.js' %} <script type="text/javascript" src="{{ asset_url }}"></script> {% endjavascripts %} Now this works fine if all the JS files are inside

Less Windows Node.js Hanging

戏子无情 提交于 2019-12-21 17:17:11
问题 I have been trying to setup Symfony2 on Windows so that I can use assetic with less. I have installed node.js for Windows (0.6.8). Then I have run npm install less --global and found less in C:\Users\Matt\AppData\Roaming\npm\node_modules As far as my Symfony setup, I have the master branch of Assetic (due to a bug I read about in 1.0.2), but the standard v1.0.1 of AsseticBundle After some work, I was able to get an example less file to render via: http://localhost/app_dev.php/css/compiled

symfony2 - the assetic assetic:dump command doesn't create stylesheets correctly

好久不见. 提交于 2019-12-21 16:58:56
问题 For some reason I can't load the css files. Here is the structure of the bundle that I use BD WebsiteBundle public css And here is how I try to load the css files {% stylesheets 'bundles/bdwebsite/css/*' filter='cssrewrite' %} <link rel="stylesheet" href="{{ asset_url }}" /> {% endstylesheets %} I did assetic:dump What I'm doing wrong? 回答1: You referred to bundles/bdwebsite/css/* in your stylesheets tag. This way assetic looks for all css files in web/bundles/bdwebsite/css (a folder that

How to optimally serve and load JavaScript files?

故事扮演 提交于 2019-12-21 12:11:07
问题 I'm hoping someone with more experience with global-scale web applications could clarify some questions, assumptions and possible misunderstandings I have. Let's take a hypothetical site (heavy amount of client-side / dynamic components) which has hundreds of thousands of users globally and the sources are being served from one location (let's say central Europe). If the application depends on popular JavaScript libraries, would it be better to take it from the Google CDN and compile it into

Assetic unable to find file

僤鯓⒐⒋嵵緔 提交于 2019-12-20 18:31:43
问题 I am trying to link a css file (that lives in a bundle) inside a twig template : {% stylesheets '@AcmeFooBundle/Resources/public/css/bootstrap.min.css' %} <link href="{{ asset_url }}" rel="stylesheet"/> {% endstylesheets %} The first error message I get is: You must add AcmeFooBundle to the assetic.bundle config... This is the config : # Assetic Configuration assetic: debug: %kernel.debug% use_controller: false bundles: [] #java: /usr/bin/java filters: cssrewrite: ~ #closure: # jar: %kernel

Assetic - Route “_assetic_001d5b7_0” does not exist

Deadly 提交于 2019-12-20 09:49:31
问题 This question seems to have been asked multiple times but none of the solutions work for me. I'm in my prod environment, here is what I've done: cleared cache before/after doing anything attempted commenting out the _assetic stuff in config_dev and ensure it isn't anywhere else (not that this should matter in prod env) set use_controller to both true and false (obviously works with true but doesn't use the compiled files) Is there anything else I'm missing? The files are generating completely