Skip to content
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

Closed

Conversation

javiereguiluz
Copy link
Member

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`:
Copy link
Member

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!" />
Copy link
Member

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

Copy link
Member

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!" />

Copy link
Member

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)

Copy link
Member

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%

@wouterj
Copy link
Member

wouterj commented Jul 28, 2015

Thanks @javiereguiluz! I'm closing this one in favor of #5574 , where I continued your work here.

@wouterj wouterj closed this Jul 28, 2015
xabbuh added a commit that referenced this pull request May 9, 2016
…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
@javiereguiluz javiereguiluz deleted the update_twig_templates branch May 24, 2018 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants