Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!$a) {
- return ['#markup' => 'no'];
- }
- return new TrustedRedirectResponse($url);
- public function mycontroller() {
- Drupal::service('page_cache_kill_switch')->trigger();
- if (!$a) {
- return [
- '#markup' => 'no',
- '#cache' => ['max-age' => 0],
- ];
- }
- return (new TrustedRedirectResponse($url))
- ->addCacheableDependency((new CacheableMetadata())->setCacheMaxAge(0));
- }
- my_awesome_module.do
- path: '/do-awesome'
- defaults:
- _controller: 'Drupalmy_awesome_moduleControllerMyAwesomeModuleController::doAwesome'
- options:
- no_cache: 'TRUE'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement