[Dancer-users] Keeping values on a form

ambs ambs+dancer at perl-hackers.net
Thu Dec 16 22:30:31 CET 2010


On 16/12/2010 21:28, Naveed Massjouni wrote:
> This may not be very secure, but this is how I achieve 'stickiness':
>
> get '/foo' =>  sub {
>      # route code
>      template foo =>  {
>          params(),
>          other =>  'stuff',
>      };
> };
>
> By passing params() into your template vars hash, it is evaluated in
> list context, so they will get expanded into key/value pairs and they
> will all get propogated to your template.  Inside your template, you
> will need to have something like:
>
> <input name="bar" value="[% bar %]" />
>
> I don't know off the top of my head how to handle check boxes.  But
> it's the same idea.

Trying a similar approach. But was wondering for any magic flag to add 
somewhere O:)

THanks


More information about the Dancer-users mailing list