0

I'm trying to install bootstrap to my symfony2 project. I basically followed steps from this: http://bootstrap.braincrafted.com/getting-started

However, when I try to run my server using: php app\console server:run I got this error:

[InvalidArgumentException] the file "filters/assets.xml" does not exist (in: C:..\ProjectName\vendor\symfony\assetic-bundle\Symfony\Bundle\AsseticBundle\DependencyInjection/..Resources/config).

I already go to that folder and can't found that assets.xml file.

I'm pretty sure that there's something went wrong with my config.yml file. Here is the config of assetic

assetic: java: /usr/bin/java filters: cssembed: jar: %kernel.root_dir%/Resources/java/cssembed-0.4.5.jar yui_js: jar: %kernel.root_dir%/Resources/java/yuicompressor.jar lessphp: file: %kernel.root_dir%/../vendor/leafo/lessphp/lessc.inc.php apply_to: ".less$" assets: jquery_js: inputs: - '%kernel.root_dir%/app/Resources/public/js/vendor/jquery.js' filters: [?yui_js] bootstrap_js: inputs: - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-transition.js' - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-alert.js' - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-modal.js' - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-dropdown.js' - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-scrollspy.js' - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-tab.js' - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-tooltip.js' - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-popover.js' - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-button.js' - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-collapse.js' - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-carousel.js' - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-typeahead.js' - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-affix.js' filters: [?yui_js] bootstrap_less: inputs: - '%kernel.root_dir%/../vendor/twitter/bootstrap/less/bootstrap.less' filters: [lessphp,cssembed]

Can anyone help me out?

3
  • What OS are you using? Windows i suggest right? Commented May 23, 2013 at 3:04
  • Yes, Windows. Could you take a look at my config.yml for assetic. I have no idea Commented May 23, 2013 at 3:08
  • 1
    please see my answer. and please fix your config.yml in the question! Commented May 23, 2013 at 3:12

2 Answers 2

1

As i see you have configured lessphp as one of your assetic filters and not less ( as you are on windows and have not configured less properly ). Change config.yml this to actually use lessphp instead of the less command

# app/config/config.yml

assetic:
    # ...
    assets:
        bootstrap_css:
            inputs:
                - %kernel.root_dir%/../vendor/twitter/bootstrap/less/bootstrap.less
                - %kernel.root_dir%/../vendor/twitter/bootstrap/less/responsive.less
            filters:
                - lessphp             # change this form less to lessphp

Furthermore there might be something wrong with your paths , looking at the error:

C:..\ProjectName\vendor\symfony\asseticbundle\Symfony\Bundle\AsseticBundle\DependencyInjection/..Resources/config

... should be a valid path like ...

C:\ProjectName\vendor\symfony\assetic-bundle\Symfony\Bundle\AsseticBundle\DependencyInjection/../Resources/config

... for symfony/php to actually be able find filters/assets.xml.

Sign up to request clarification or add additional context in comments.

Comments

1

I just went through this and found this bundle more helpful than trying to install it outright ...

https://github.com/phiamo/MopaBootstrapBundle

It's documentation can be a little fuzzy, but overall it worked fairly well. I used it with SASS, but it has LESS and plain CSS options as well.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.