Thanks.

четверг, 23 апреля 2015 г., 4:04:45 UTC+3 пользователь Dan Book написал:
>
> Multi-parameter support has been removed from Mojo::Parameters (see 
> https://github.com/kraih/mojo/wiki/Upgrading#multi-name-parameter-retrieval 
> )
>
> You can retrieve them individually:
> my $name = $self->req->param('name');
>
> Or you can use the hash functionality with a hash slice:
> my ($name, $email, $subject, $message) = 
> @{$self->req->params->to_hash}{'name','email','subject','message'};
>
> Also, instead of $r->any('/form')->via('post') you can just write 
> $r->post('/form')
>
> On Wed, Apr 22, 2015 at 7:19 PM, Marlik <[email protected] <javascript:>
> > wrote:
>
>> Hello... I can't get params from form.
>>
>> Routs:
>>
>> $r->get('/')->to('example#index')->name('index');
>> $r->any('/form')->via('post')->to('example#check_form');
>> $r->any('/message')->via('post')->to('example#message');
>> Controller message:
>>
>> my $self = shift;
>>
>> my ($name, $email, $subject, $message) = 
>> $self->req->body_params->param(['name', 'email', 'subject', 'message']);
>>
>>  if (( defined $name) && ( defined $email ) && ( defined $subject ) && ( 
>> defined $message )){
>>     
>>  $self->flash(success_send_message => "SUCCESS");
>>  $self->redirect_to('/#message');
>>
>>   }else{
>>      
>>  $self->flash(error_send_message => "ERROR");
>>  $self->redirect_to('/#message'); 
>>
>> }
>>
>> ???
>>
>> My english is bed, sorry.
>>
>> Thanks.
>>
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/mojolicious.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to