assetic

Fontawesome fonts fail after assets:install and assetic:dump

早过忘川 提交于 2019-11-30 23:52:29
I'm trying to setting up a site I'm working on at shared hosting and all works fine but FontAwesome icons since Symfony does not find them where they should be. I follow this steps to move the site to production shared hosting: Publish assets as hard copy since SH doesn't allow symlink so I run this command assets:install Publish assets handled by Assetic by running this commands: assetic:dump (dev) and assetic:dump --env=prod (prod) But it's not working since I'm getting this errors at Firebug all the time: "NetworkError: 404 Not Found - http://tanane.com/bundles/backend/img/mybg.png"

Symfony2 Path to image in twig template

走远了吗. 提交于 2019-11-30 17:06:46
I store img in Acme/DemoBundle/Resources/public/img/weather_icon/blizzard.gif I want to put this img in my template so I did <img src="{{ asset('bundles/acmedemo/img/weather_icons/blizzard.gif') }}" /> and <img src="{{ asset('..img/weather_icons/blizzard.gif') }}" /> and And this did't work. I did assets:install and assetic:dump Solved it worked <img src="{{ asset('img/weather_icons/Blizzard.gif') }}" alt="Symfony!" /> Please try this <img src="{{ asset('bundles/acmedemo/img/weather_icons/blizzard.gif') }}" /> You should istall your assets into web directory with the command app/console assets

Symfony2 +Vagrant performance - running slow - speeding up?

泄露秘密 提交于 2019-11-30 16:12:14
I have started using vagrant with Symfony2.* to develop Web projects. I am using Windows, performance is very slow, because nfs mount isn't supported. I've put cache into memory, which gave exotic boost, disabled xdebug (as posted here ). However page still loads in more than 14 seconds in dev enviroment on windows machines. Any help would be appreciated. Symfony >=2.3, PHP >= 5.4, Windows 7, Dell Precission m6700 quad-core i7/16GB/SSD I've had the same performance problems, although with developing Drupal sites (also PHP based). Lately I've had quite some success by using the new rsync folder

symfony2 assetics yui compressor on windows (path syntax)

 ̄綄美尐妖づ 提交于 2019-11-30 16:04:56
问题 I'm trying to get assetics running with the yui compressor and, if this is running, sass. Right now, both don't work. When removing all filters from config.yml and the twig template, it works and php app/console assetic:dump does copy the css and js files. Now I want to add the yui compressor and my config.yml looks like this: assetic: debug: %kernel.debug% use_controller: false filters: yui_js: jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.6.jar Adding the filter to the template

symfony2 assetics yui compressor on windows (path syntax)

人走茶凉 提交于 2019-11-30 15:56:31
I'm trying to get assetics running with the yui compressor and, if this is running, sass. Right now, both don't work. When removing all filters from config.yml and the twig template, it works and php app/console assetic:dump does copy the css and js files. Now I want to add the yui compressor and my config.yml looks like this: assetic: debug: %kernel.debug% use_controller: false filters: yui_js: jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.6.jar Adding the filter to the template and running assetic:dump again ends in the following error (translation of message by me):

Adding JS and CSS cleanly from included Twig templates

六眼飞鱼酱① 提交于 2019-11-30 14:51:24
问题 I'm looking to find out if there's a clean way to add JS and CSS from included templates. So, for example, if layout.html.twig has: {% include 'GenericBundle:Generic:page.html.twig' with {'data': data} %} ... {% block javascript %} {% javascripts '@GenericBundle/Resources/public/js/app/jquery/jquery.min.js' '@GenericBundle/Resources/public/js/lib/bootstrap/bootstrap.min.js' %} <script src="{{ asset_url }}"></script> {% endjavascripts %} {% endblock %} And in the generic bundle page I'd like

Symfony2 Assetic get asset urls from inside controller, not template

跟風遠走 提交于 2019-11-30 08:46:51
I want to include the url to one of the assets in my bundle in the controller, not in the template. More specifically, but not very important: I make a HighChart chart using obHighChartsBundle, and I have to plot some special icons in some points of the graph I am producing. Therefore I need the url to the icon, which is in my bundle's asset folder. Is it possible to call some kind of asset manager from the controller and get the correct url to this asset? tomas.pecserke You can call ($packageName is optional): $this->container->get('assets.packages')->getUrl($path, $packageName); For older

How can I force assetic to render assets each time the page is reloaded?

时光怂恿深爱的人放手 提交于 2019-11-30 07:05:19
How can I force assetic to render assets each time the page is reloaded (no matter if assets are modified or not)? More explanation about my issue: I'm currently working on a Symfony2 project where I use Assetic to manage and compile .less files. I got everything to work fine but I'm having a small issue that I'd like to fix. In config.yml, I set the assetic use_controller to true. # Assetic Configuration assetic: debug: %kernel.debug% use_controller: true The result is that Symfony dynamically renders the new .css files each time .less files are modified. This is great. My problem is that I

Symfony2 Path to image in twig template

社会主义新天地 提交于 2019-11-30 01:09:55
问题 I store img in Acme/DemoBundle/Resources/public/img/weather_icon/blizzard.gif I want to put this img in my template so I did <img src="{{ asset('bundles/acmedemo/img/weather_icons/blizzard.gif') }}" /> and <img src="{{ asset('..img/weather_icons/blizzard.gif') }}" /> and And this did't work. I did assets:install and assetic:dump Solved it worked <img src="{{ asset('img/weather_icons/Blizzard.gif') }}" alt="Symfony!" /> 回答1: Please try this <img src="{{ asset('bundles/acmedemo/img/weather

AsseticBundle removed from all the Symfony's versions

喜夏-厌秋 提交于 2019-11-29 18:25:02
I wanted to know why AsseticBundle has been removed from all the versions of Symfony. I looked everywhere and I don't found any site talking about this news that began for some weeks. Initially, I thought they deleted this Bundle because there is a security flaw that will take a few days to be repaired. This Bundle is indisponsable for including javascript and css file type from an external folder and I wanted to be sure if this Bundle wille be replaced by an another in Symfony or I should add this Bundle manually. Thanks The AsseticBundle is not compatible/maintained with the new version of