Browse Source

表单的 table 模式需要自定义视图

form 的 table 模式不支持自定义视图
```php
$form->table(...)->setView(...)
```
需修改为下:
```php
$this->view = $this->view ?: $this->views[$this->viewMode];
```
Jesse Chen 4 năm trước cách đây
mục cha
commit
a3c977a6bb
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/Form/Field/HasMany.php

+ 2 - 2
src/Form/Field/HasMany.php

@@ -522,7 +522,7 @@ class HasMany extends Field
         }
 
         // specify a view to render.
-        $this->view = $this->views[$this->viewMode];
+        $this->view = $this->view ?: $this->views[$this->viewMode];
 
         $this->addVariables([
             'forms'          => $this->buildRelatedForms(),
@@ -573,7 +573,7 @@ class HasMany extends Field
         $template .= '<td class="hidden">'.implode('', $hidden).'</td>';
 
         // specify a view to render.
-        $this->view = $this->views[$this->viewMode];
+        $this->view = $this->view ?: $this->views[$this->viewMode];
 
         $this->addVariables([
             'headers'      => $headers,