-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Updated Twig template to take into account asset() function changes #5171
Conversation
javiereguiluz
commented
Apr 13, 2015
Q | A |
---|---|
Doc fix? | yes |
New docs? | no |
Applies to | 2.7+ |
Fixed tickets | #4982 (partially) |
@@ -1019,46 +1019,12 @@ assets won't be cached when deployed. For example, ``/images/logo.png`` might | |||
look like ``/images/logo.png?v2``. For more information, see the :ref:`ref-framework-assets-version` | |||
configuration option. | |||
|
|||
.. _`book-templating-version-by-asset`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we have anything version-related left in the docs when this is removed?
null, | ||
true | ||
) ?>" alt="Symfony!" /> | ||
<img src="{{ absolute_url(asset('images/logo.png')) }}" alt="Symfony!" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have to document the PHP format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the PHP format:
<img src="<?php echo $view['assets']->getUrl('images/logo.png') ?>" alt="Symfony!" />
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm no sorry. I'm missing the absolute_url part. I'm not sure we have the helper for that in the PHP templating engine though
however, the exsting doc is wrong too. Even in the deprecated asset system, there is no way to get an absolute URL in the PHP helper (the deprecated third argument is the version, not an absolute flag)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no PHP helper for it, it should be added during this stabilisation phase imo. Symfony 2.x still has to support PHP templating for 100%
24a36ef
to
ab0d4db
Compare
Thanks @javiereguiluz! I'm closing this one in favor of #5574 , where I continued your work here. |
…z, WouterJ) This PR was merged into the 2.7 branch. Discussion ---------- [2.7] Update Twig docs for asset features Finishes #5171 | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.7+ | Fixed tickets | #4982 (partially) Commits ------- 0cd7e6c Correctly document new twig functions bc18ff1 Updated Twig template to take into account asset() function changes