开发者

How to create a submitted CGI::FormBuilder object?

开发者 https://www.devze.com 2023-03-26 05:40 出处:网络
I have a method that takes a cgi object and creates a CGI::FormBuilder object. if it is submitted, does a db connection and process data otherwise, prepopulates some data and renders the form.

I have a method that takes a cgi object and creates a CGI::FormBuilder object. if it is submitted, does a db connection and process data otherwise, prepopulates some data and renders the form.

I want to write a unit test for it. Therefore, I want to give it a cgi object and it will create a submitted form and pr开发者_运维知识库ocess data.

Which parameter must be specified in cgi to do form to be submitted?

Thanks in advance.


Parameter is (submittedname_of_the_form)_(name_of_the_form)


Probably you want:

$q = CGI->new(INPUTFILE);
#or
$q = CGI->new(\*STDIN);
#or 
$q = CGI->new($my_query_string);
#or
$q = CGI->new(\%my_form_params);

As described on CPAN CGI page

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号