Reputation: 942
i want to send variables when using the codeIgniter form helper.
The function in the controller takes two variables like:
public function doSomething($var1, $var2){
...
}
In the form helper I want to do something like this:
echo form_open('Controller/doSomething($var1, $var2)');
echo form_submit('doIt', 'Do it');
How can I do this because the above doesn't seem to work.
Upvotes: 0
Views: 62
Reputation: 4592
echo form_open('controller/method', array('id'=>'id'), array('var1'=>$var1));
OR
echo form_open("controller/method/$var1/$var2", array('id'=>'id'));
Upvotes: 1