Skip to content

Commit

Permalink
adjust doc to use class name as service name
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Feb 26, 2024
1 parent bb4c7f0 commit 13be8f6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Resources/doc/basic-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ available filters will be resolved).
Resolve Programmatically
~~~~~~~~~~~~~~~~~~~~~~~~

You can resolve the image URL in your code using the ``getBrowserPath``
method of the ``liip_imagine.cache.manager`` service. Assuming you already
have the service assigned to a variable called ``$imagineCacheManager``,
You can resolve the image URL in your code using the ``getBrowserPath`` method
of the ``Liip\ImagineBundle\Imagine\Cache\CacheManager`` service. Assuming you
already have the service assigned to a variable called ``$imagineCacheManager``,
you would run:

.. code-block:: php
Expand All @@ -214,17 +214,15 @@ you would run:
Often, you need to perform this operation in a controller.

You can access the ``CacheManager`` simply by type hinting it in your controller method: the service
``liip_imagine.cache.manager`` will be automatically injected and you will be able to call
``getBrowserPath`` on a relative image path to get its resolved location.
In a controller, this can look as follows:

.. code-block:: php
<?php
namespace App\Controller;
use \Liip\ImagineBundle\Imagine\Cache\CacheManager;
use Liip\ImagineBundle\Imagine\Cache\CacheManager;
class YourController
{
Expand Down

0 comments on commit 13be8f6

Please sign in to comment.