Jelajahi Sumber

widget form修改action

Jiang qinghua 4 tahun lalu
induk
melakukan
b1d000fdbc
1 mengubah file dengan 1 tambahan dan 2 penghapusan
  1. 1 2
      src/Widgets/Form.php

+ 1 - 2
src/Widgets/Form.php

@@ -210,7 +210,6 @@ class Form implements Renderable
     {
         $this->setHtmlAttribute([
             'method'         => 'POST',
-            'action'         => '',
             'class'          => 'form-horizontal',
             'accept-charset' => 'UTF-8',
             'pjax-container' => true,
@@ -837,7 +836,7 @@ HTML;
         if ($this->allowAjaxSubmit() && method_exists($this, 'handle')) {
             $addHiddenFields = function () {
                 $this->method('POST');
-                $this->action(route(admin_api_route_name('form')));
+                $this->defaultHtmlAttribute('action', route(admin_api_route_name('form')));
                 $this->hidden(static::REQUEST_NAME)->default(get_called_class());
                 $this->hidden(static::CURRENT_URL_NAME)->default($this->getCurrentUrl());