Mercurial > hg > cmmr2012-drupal-site
annotate vendor/chi-teck/drupal-code-generator/templates/d8/service/response-policy.twig @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | c75dbcec494b |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\{{ machine_name }}\PageCache; |
Chris@0 | 4 |
Chris@0 | 5 use Drupal\Core\PageCache\ResponsePolicyInterface; |
Chris@0 | 6 use Symfony\Component\HttpFoundation\Request; |
Chris@0 | 7 use Symfony\Component\HttpFoundation\Response; |
Chris@0 | 8 |
Chris@0 | 9 /** |
Chris@0 | 10 * A policy disallowing caching requests with certain cookies. |
Chris@0 | 11 */ |
Chris@0 | 12 class {{ class }} implements ResponsePolicyInterface { |
Chris@0 | 13 |
Chris@0 | 14 /** |
Chris@0 | 15 * {@inheritdoc} |
Chris@0 | 16 */ |
Chris@0 | 17 public function check(Response $response, Request $request) { |
Chris@0 | 18 if ($request->cookies->get('foo')) { |
Chris@0 | 19 return self::DENY; |
Chris@0 | 20 } |
Chris@0 | 21 } |
Chris@0 | 22 |
Chris@0 | 23 } |