Skip to content

Commit 787c341

Browse files
committed
minor #17975 [HttpCache] Add example with an attribute (HypeMC)
This PR was merged into the 6.2 branch. Discussion ---------- [HttpCache] Add example with an attribute Followup to #17972. Adds an example using an attribute. Commits ------- e992925 [HttpCache] Add example with an attribute
2 parents e0edc58 + e992925 commit 787c341

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

http_cache/cache_invalidation.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,22 @@ Then, register the class as a service that :doc:`decorates </service_container/s
9090

9191
.. configuration-block::
9292

93+
.. code-block:: php-attributes
94+
95+
// src/CacheKernel.php
96+
namespace App;
97+
98+
// ...
99+
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
100+
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;
101+
102+
#[Autoconfigure(bind: ['$surrogate' => '@?esi'])]
103+
#[AsDecorator(decorates: 'http_cache')]
104+
class CacheKernel extends HttpCache
105+
{
106+
// ...
107+
}
108+
93109
.. code-block:: yaml
94110
95111
# config/services.yaml

0 commit comments

Comments
 (0)