Quickly add bootstrap, jquery and more from CDNs 2016-05-17 20:19 UTC

This package is auto-updated.

Last update: 2024-05-10 19:35:01 UTC


Building websites around modern JavaScript and responsive CSS libraries can be a bit of a pain. Let us introduce the FoundationBundle that makes building a useful foundation easy as pie.


No configuration needed at this time.


CDNs can be updated from the console, using the foundation:update action:

$ app/console foundation:update

CdnJs and BootstrapCdn are included.


To use foundation, use the foundation() Twig tag in the head of your document:

    <title>My Website</title>
    {{ foundation('jquery,twitter-bootstrap') }}

You can also specifiy components as an array if you prefer:

{{ foundation([ "jquery", "twitter-bootstrap" ]) }}

Finding components

Use the foundation:search command to find components:

$ app/console foundation:search jquery

To find the URL of a component, for testing:

$ app/console foundation:component jquery

Static template

not implemented

To dump a static template with the required links and script tags, use the foundation:dump command.

$ app/console foundation:dump > app/Resources/views/foundation.html.twig

Finding usable components

$ app/console foundation:search bootswatch
 - bootswatch (Cdnjs)
 - bootswatch-amelia (BootstrapCdn)
 - bootswatch-cerulean (BootstrapCdn)
 - bootswatch-cosmo (BootstrapCdn)

In this case, you should be able to add bootswatch-cerulean to your foundation call to make your site use the cerulean bootswatch theme for bootstrap:

    {{ foundation([
    ]) }}