CodeIgniter Forums
form open - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: form open (/showthread.php?tid=70652)



form open - davy_yg - 05-08-2018

I have a question will form open always using post method?

For example:

echo form_open('email/send');

the same thing like:  <form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send">

What if I want to use get method?


RE: form open - neuron - 05-08-2018

In system/helpers/form_helper.php:
PHP Code:
    function form_open($action ''$attributes = array(), $hidden = array())
    {

//some codes here
        
$attributes _attributes_to_string($attributes);

        if (
stripos($attributes'method=') === FALSE)
        {
            
$attributes .= ' method="post"';
        }


//some codes here

    


As you can see you can set method using $attributes array