-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Grouped assets example #8574
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
Grouped assets example #8574
Conversation
When absolute path is provided in getUrl(), base path is ignored.
Hey @takman1! If I understand it correctly, both |
Hello Ryan, |
Ah, of course! You're right, and this is an important point. But there are many other times in this article when we use @takman1 could you make those changes? |
Hi @weaverryan, |
How alsolute paths are handeled in Package and PathPackage.
This is great! Thank you @takman1! |
This PR was squashed before being merged into the 3.3 branch (closes #8574). Discussion ---------- Grouped assets example Asset > PathPackage > Grouped assets section > example When absolute path is provided in getUrl(), base path is ignored. Commits ------- a29765d Asset Component and absolute paths 95a79fd Grouped assets example
How to reproduce : - Application has a base url (/some-base-url) - Using "PathPackage" - Using RequestStackContext (3rd parameter), - getUrl of asset with absolute path. Result : Both "base url" of application and "base path" of PathPackage are ignored. Example : Application base url : /some-prefix $package = new PathPackage('/static/', new StaticVersionStrategy('v1.2'), new RequestStackContext($requestStack)); echo $package->getUrl("/img.png"); // /img.png?v1.2 Check merged PR symfony#8574. NB : Maybe there a conception problem in Asset component. I my opinion only "base path" should be ignored but "base url" should always be used to prefix the generated asset path.
This PR was merged into the 3.3 branch. Discussion ---------- Path package in context aware How to reproduce : - Application has a base url (/some-base-url) - Using "PathPackage" - Using RequestStackContext (3rd parameter), - getUrl of asset with absolute path. Result : Both "base url" of application and "base path" of PathPackage are ignored. Example : Application base url : /some-prefix $package = new PathPackage('/static/', new StaticVersionStrategy('v1.2'), new RequestStackContext($requestStack)); echo $package->getUrl("/img.png"); // /img.png?v1.2 Check merged PR #8574. NB : Maybe there a conception problem in Asset component. I my opinion only "base path" should be ignored but "base url" should always be used to prefix the generated asset path. Commits ------- 0dbb635 Path package in context aware
Asset > PathPackage > Grouped assets section > example
When absolute path is provided in getUrl(), base path is ignored.