NAME

Mojolicious::Plugin::GroupedParams - grouped params from query.

VERSION

Version 0.04

SYNOPSIS

use Mojolicious::Lite;

plugin 'grouped_params';

post '/save_article' => sub {
    my ( $self ) = @_;

    my $new_article = $self->grouped_params('article');

    $self->db->resultset('Article')->create($new_article);

};

# In template
<input name="article.name" value="<%= grouped_params('article')->{name} %>" />
<textarea name="article.text"><%= grouped_params('article')->{text} %></textarea>

CONFIG

delimiters

Set delimiters to split parameters names. Default is [ "." ]

$self->plugin( 'grouped_params', {delimiter => [ "-", "."] } )

FUNCTIONS

register

Register plugin

grouped_params

This helper groups params with name like <group>.<name> and put grouped params into stash variable "grouped_params".

AUTHOR

Ivan Sokolov, <ivsokolov at cpan.org>

BUGS

Please report any bugs or feature requests to bug-mojolicious-plugin-groupedparams at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Mojolicious-Plugin-GroupedParams. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

LICENSE AND COPYRIGHT

Copyright 2010 Ivan Sokolov.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.