Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

OurNet::WebBuilder
Web rendering for BBS-based services

OurNet::WebBuilder - Web rendering for BBS-based services


NAME

OurNet::WebBuilder - Web rendering for BBS-based services


SYNOPSIS


    use OurNet::WebBuilder;

    my $tmpl = {

        dir     => \%dir,

        article => \%article,

        cgi_url => CGI->url

    };

    my $opref = {

        '' => sub {

            return '!view';

        },

        'view' => sub {

            $tmpl->{'menu'} ||= param('curdir') || $dir{'oin'}[0]{id};

            $tmpl->{'curdir'} ||= param('curdir') || $dir{'oin'}[0]{id};

            loadboard($tmpl->{'curdir'});

            loadarticle(

                $_->{'id'},

                ($tmpl->{'curdir'} eq 'bbs' ? $bbs 

                                            : ($oin, $tmpl->{'curdir'})))

                foreach @{$dir{$tmpl->{'curdir'}}};

            return 'view';

        }

    };

    OurNet::WebBuilder::Display($tmpl, $opref);


DESCRIPTION

the method Display takes $tmpl, which is a variable pool, and $opref, which is hash of mapping from 'op' to the subroutine for that 'op'.

The op routine fill in the $tmpl with the varialbes it would like the variable pool to have, and returns the name of the template file that would be used. or if the return value begins with '!', the variable pool will be transit to the specified op again.

You may set $OurNet::WebBuilder::Backend to specify a specific rendering package. Currently, OurNet::Template, Template and HTML::Template are supported.


SEE ALSO

the OurNet::Template manpage, Template, the HTML::Template manpage


AUTHORS

Autrijus Tang <autrijus@autrijus.org>


COPYRIGHT

Copyright 2001 by Autrijus Tang <autrijus@autrijus.org>.

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

See http://www.perl.com/perl/misc/Artistic.html

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy