HTML::ArrayGenerator - Easy generation of a HTML array


NAME

HTML::ArrayGenerator - Easy generation of a HTML array


SYNOPSIS

Here's some examples :

      use HTML::ArrayGenerator;
      
      my $gen = ArrayGenerator->new;
      # first we build the array...
      $gen->set(0, 0, title => "First");
      $gen->set(0, 1, title => "Second");
      $gen->set(1, 1, text => "first sentence", align => "center");
      # two things in same case ? then the second is on a newline 
      $gen->set(1, 1, text => "second sentence", link => "www.perldoc.com");
      $gen->set(0, 2, img => "perl.png", alt => "My favorite camel");
      $gen->set(0, 3, img => "perl.png", alt => "Always my favorite camel", link => "www.cpan.org");            
      # some complex code
      $gen->set(0, 10, code => "<td> <ul><p>first<p>second</ul> </td"); 
      
      # then we generate it...
      $gen->generate_page (\*STDOUT, title => "Title of the page", array_title => "A title...", border => 10);
      $gen->generate_array(\*STDOUT,  border => 10);


DESCRIPTION

There are three functions for generating an HTML array.

ArrayGenerator::set($x, $y, %hash)

Use the set method to build your array. The first and second argument are the coordinates of a case in the array. The third argument is a hash. Possible keys are : title, text, link, img, alt, and align.

ArrayGenerator::generate_array($REF_FILE_DESCRIPTOR, %hash)

Output the HTML code for your array. The second argument is a hash. The only key is border, which set the size of the border of the HTML array.

ArrayGenerator::generate_page($REF_FILE_DESCRIPTOR, %hash)

Output an HTML page which contains the HTML array. The second argument is a hash. Possible keys are : title, array_title and border. Title is the title of the HTML page and array_title the title of the array.


AUTHOR

Kototama <codeur(at)altern.org>


Copyright

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.