How to remove the action attribute in the form_open_multipart() in Codeigniter?

前端 未结 1 1056
余生分开走
余生分开走 2021-01-26 06:42

Is there a way that I can remove the action attribute in CodeIgniter?

The code would normally be like this:

form_open_multipart(\'person/add\', $attribut         


        
1条回答
  •  无人及你
    2021-01-26 07:09

    Sure you can but consider:

    1) The action attribute has a meaning and a function, don't know why you want it out

    2) You can always pass it an empty string :

      
    

    or

    gives:

      

    In case you're really sure about this, just open up the form_helper.php file, located in system/helpers/form_helper.php.

    Pick lines 59 - 65 :

    $action OR $action = $CI->config->site_url($CI->uri->uri_string());
    $form = '

    and change line 60 to

    $form = '

    form_open_multiaction() just picks the form_open() and adds the enctype attribute, so you change form_open() and you're set.
    It's up to you now, I still fail to see why an empty action won't suffice to your goals.

    0 讨论(0)
提交回复
热议问题