316295529c47215343862f0f809a969af730e6c5
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / service / request-policy.twig
1 <?php
2
3 namespace Drupal\{{ machine_name }}\PageCache;
4
5 use Drupal\Core\PageCache\RequestPolicyInterface;
6 use Symfony\Component\HttpFoundation\Request;
7
8 /**
9  * A policy allowing to bypass cache for requests with 'no-cache' parameter.
10  *
11  * Example: https://example.com/node?no-cache.
12  */
13 class {{ class }} implements RequestPolicyInterface {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function check(Request $request) {
19     if (!is_null($request->get('no-cache'))) {
20       return self::DENY;
21     }
22   }
23
24 }