Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Gantry::Utils::FormMunger 3.51

    Download button

    No screenshots available
    Downloads: 336  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.7/5)
    8 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Phil Crow | More programs
    Perl Artistic License / FREE
    May 14th, 2008, 15:29 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Gantry::Utils::FormMunger description

    Gantry::Utils::FormMunger munges form hashes like the ones bigtop makes.

    Gantry::Utils::FormMunger munges form hashes like the ones bigtop makes.

    SYNOPSIS

    use Gantry::Utils::FormMunger;

    my $form = ...; # make a form hash

    my $munger = Gantry::Utils::FormMunger->new( $form );

    # change properties of existing fields:
    $munger->clear_props( 'field_name', qw( name keys to delete) );

    $munger->clear_all_props( 'field_name' );
    # removes all keys except name

    $munger->set_props(
    'field_name',
    { prop => 'value', ... },
    $replace_props
    ); # modifies only the keys you pass

    $munger->set_props_for_fields(
    [ 'field1', 'field2', ... ],
    { prop => 'value', ... },
    ); # like set_props but for all listed fields

    $munger->set_props_except_for(
    [ 'skip_this_one', 'and_this_one' ],
    { prop => 'value', ... },
    ); # like set_props_for, but negated listed fields are skipped

    $munger->set_props_all( { prop => 'value', ... } );

    # get the field so you can work it yourself:
    my $field = $munger->get_field( 'name' );

    # modify the field list:
    my $deceased = $munger->drop_field( 'name' ); # removes it from the form

    $munger->append_field( { name => 'name', ... } ); # add at end
    $munger->unshift_field( { name => 'name', ... } ); # add at beginning

    $munger->add_field_after( 'target', { name => 'name', ... } );
    $munger->add_field_before( 'target', { name => 'name', ... } );

    This module is designed to simplify work with Gantry form.tt form hash data structures. If makes modifications to the fields array in that hash. Usually, bigtop generates that hash. If you are in a standard CRUD situation, the generated form is all you need. But, if you need to share the form in different contexts, it may be necessary to modify it to suit those contexts. That is what this module does.

    If you want, you could even use this module to build your entire form hash, but that might be painful. Instead, you usually pass a form hash to its constructor. Usually, you get that hash from a GEN module's form method which was generated by bigtop.

    Once you have the object, you can call any of the methods below to modify its fields array. Most of the methods return nothing useful. The exceptions are noted below.

    All methods are instance methods unless marked.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Gantry utils | form munger | Perl module | Gantry | form | munger

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM