Skip to content

[Cookbook][Assetic] Fix "javascripts" tag name typo #3485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 1, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 34 additions & 6 deletions cookbook/assetic/asset_management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ behind adding either is basically the same, but with a slightly different syntax
Including JavaScript Files
~~~~~~~~~~~~~~~~~~~~~~~~~~

To include JavaScript files, use the ``javascript`` tag in any template.
This will most commonly live in the ``javascripts`` block, if you're using
the default block names from the Symfony Standard Distribution:
To include JavaScript files, use the ``javascripts`` tag in any template:

.. configuration-block::

Expand All @@ -73,6 +71,22 @@ the default block names from the Symfony Standard Distribution:
<script type="text/javascript" src="<?php echo $view->escape($url) ?>"></script>
<?php endforeach; ?>

.. note::

If you're using the default block names from the Symfony Standard Edition,
the ``javascripts`` tag will most commonly live in the ``javascripts``
block:

.. code-block:: html+jinja

{# ... #}
{% block javascripts %}
{% javascripts '@AcmeFooBundle/Resources/public/js/*' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock %}
{# ... #}

.. tip::

You can also include CSS Stylesheets: see :ref:`cookbook-assetic-including-css`.
Expand All @@ -95,9 +109,7 @@ Including CSS Stylesheets
~~~~~~~~~~~~~~~~~~~~~~~~~

To bring in CSS stylesheets, you can use the same methodologies seen
above, except with the ``stylesheets`` tag. If you're using the default
block names from the Symfony Standard Distribution, this will usually live
inside a ``stylesheets`` block:
above, except with the ``stylesheets`` tag:

.. configuration-block::

Expand All @@ -116,6 +128,22 @@ inside a ``stylesheets`` block:
<link rel="stylesheet" href="<?php echo $view->escape($url) ?>" />
<?php endforeach; ?>

.. note::

If you're using the default block names from the Symfony Standard Edition,
the ``stylesheets`` tag will most commonly live in the ``stylesheets``
block:

.. code-block:: html+jinja

{# ... #}
{% block stylesheets %}
{% stylesheets 'bundles/acme_foo/css/*' filter='cssrewrite' %}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
{% endblock %}
{# ... #}

But because Assetic changes the paths to your assets, this *will* break any
background images (or other paths) that uses relative paths, unless you use
the :ref:`cssrewrite <cookbook-assetic-cssrewrite>` filter.
Expand Down