浏览代码

user_materio user_block cache max-age 0

bach 3 周之前
父节点
当前提交
8b2c26774f
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      web/modules/custom/materio_user/src/Plugin/Block/UserBlock.php

+ 7 - 0
web/modules/custom/materio_user/src/Plugin/Block/UserBlock.php

@@ -50,6 +50,11 @@ class UserBlock extends BlockBase   implements ContainerFactoryPluginInterface{
    */
   public function build() {
     $build = [];
+    
+    $build['#cache'] = [
+      'max-age' => 0,
+    ];
+    
     // dpm($this->user);
     if($this->user->id()){
       $user_url = Url::fromRoute('entity.user.canonical', ['user' => $this->user->id()]);
@@ -76,6 +81,8 @@ class UserBlock extends BlockBase   implements ContainerFactoryPluginInterface{
           )
         )
       );
+
+      
     }
     return $build;
   }