Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 2 commits intosymfony:2.3frombicpi:fix_assetic_tag_name
Feb 1, 2014
Merged
Changes fromall 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 deletionscookbook/assetic/asset_management.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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

[8]ページ先頭

©2009-2025 Movatter.jp