Skip to content

Proofreading tweaks to asset component #5082

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
Mar 22, 2015
Merged
Changes from 1 commit
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
Prev Previous commit
Changes thanks to WouterJ and xabbuh
  • Loading branch information
weaverryan committed Mar 22, 2015
commit 59325eee748539e9dd5f5b31459d3fe46ab9a87c
22 changes: 11 additions & 11 deletions components/asset/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ which defines the following two methods:
With a package, you can:

A) :ref:`version the assets <component-assets-versioning>`;
B) set a :ref:`common base path (e.g. /css) <component-assets-path-package>`
B) set a :ref:`common base path <component-assets-path-package>` (e.g. ``/css``)
for the assets;
C) :ref:`configure a CDN <component-assets-cdn>` for the assets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing final stop

btw, why using an ordered list instead of an unordered list?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I LOVE ordered lists - they have the nice formatting of ordered but with little "reference" so we can refer to point "B" later if we want :)


Expand Down Expand Up @@ -161,7 +161,7 @@ Grouped Assets
Often, many assets live under a common path (e.g. ``/static/images``). If
that's your case, replace the default :class:`Symfony\\Component\\Asset\\Package`
class with :class:`Symfony\\Component\\Asset\\PathPackage` to avoid repeating
that path time and again::
that path over and over again::

use Symfony\Component\Asset\PathPackage;
// ...
Expand All @@ -174,8 +174,8 @@ that path time and again::
Request Context Aware Assets
............................

If you are also using the :doc:`HttpFoundation</components/http_foundation/introduction>`
component in your project (for example in a Symfony application), the ``PathPackage``
If you are also using the :doc:`HttpFoundation </components/http_foundation/introduction>`
component in your project (for instance, in a Symfony application), the ``PathPackage``
class can take into account the context of the current request::

use Symfony\Component\Asset\PathPackage;
Expand All @@ -191,11 +191,11 @@ class can take into account the context of the current request::
echo $package->getUrl('/logo.png');
// result: /somewhere/static/images/logo.png?v1

When the request context is set (via an optional third argument), in addition to
the configured base path (i.e. ``/static/images``), ``PathPackage`` also
prepends the current request base URL. So, for example, if your entire site
is hosted under the ``/somewhere`` directory in your web server root directory,
then ``/somewhere/`` will be prefixed to all paths.
Now that the request context is set, the ``PathPackage`` will prepend the
current request base URL. So, for example, if your entire site is hosted under
the ``/somewhere`` directory of your web server root directory and the configured
base path is ``/static/images``, all paths will be prefixed with
``/somewhere/static/images``.

.. _component-assets-cdn:

Expand Down Expand Up @@ -230,7 +230,7 @@ You can also pass a schema-agnostic URL::
echo $package->getUrl('/logo.png');
// result: //static.example.com/images/logo.png?v1

This is useful because assets will automatically be requested via https if
This is useful because assets will automatically be requested via HTTPS if
a visitor is viewing your site in https. Just make sure that your CDN host
supports https.

Expand Down Expand Up @@ -274,8 +274,8 @@ protocol-relative URLs for HTTPs requests, any base URL for HTTP requests)::
new RequestStackContext($requestStack)
);

// assuming the RequestStackContext says that we are on a secure host
echo $package->getUrl('/logo.png');
// assuming the RequestStackContext says that we are on a secure host
// result: https://example.com/logo.png?v1

Named Packages
Expand Down