Update Composer, update everything
This commit is contained in:
parent
ea3e94409f
commit
dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions
24
vendor/chi-teck/drupal-code-generator/templates/d8/service/request-policy.twig
vendored
Normal file
24
vendor/chi-teck/drupal-code-generator/templates/d8/service/request-policy.twig
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\{{ machine_name }}\PageCache;
|
||||
|
||||
use Drupal\Core\PageCache\RequestPolicyInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* A policy allowing to bypass cache for requests with 'no-cache' parameter.
|
||||
*
|
||||
* Example: https://example.com/node?no-cache.
|
||||
*/
|
||||
class {{ class }} implements RequestPolicyInterface {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function check(Request $request) {
|
||||
if (!is_null($request->get('no-cache'))) {
|
||||
return self::DENY;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue