mojolicious

Passing arguments to redirect_to in mojolicious and using them in the target controller

有些话、适合烂在心里 提交于 2019-11-28 03:52:43
问题 I am passing arguments to redirect_to like $c->redirect_to('named', foo => 'bar'); or $c->redirect_to('named, query => {foo=> 'bar'}); but I am not sure how to use it or retrieve the value of foo in the target controller. 回答1: $self->redirect_to('named', foo => 'bar') , used without a preceding slash, refers to named routes, and parameters are placed into route placeholders. Each route you define in your application gets assigned a route name by default, or you can assign them manually. (You