CGI-Lazy
view release on metacpan or search on metacpan
lib/CGI/Lazy.pm view on Meta::CPAN
expires => '+15m',
},
},
});
print $q->header,
$q->start_html({-style => {-src => '/css/style.css'}}),
$q->javascript->modules();
print $q->template('topbanner2.tmpl')->process({ logo => '/images/funkyimage.png', mainTitle => 'Funktastic', secondaryTitle => $message, versionTitle => '0.0.1', messageTitle => 'w00t!', });
print $q->template('navbar1.tmpl')->process({
one => 'link one',
one_link => '/blah.html',
two => 'link two',
two_link => '/blah.html',
three => 'link three',
three_link => '/blah.html',
four => 'link four',
four_link => '/blah.html',
});
print $q->template('fileMonkeyHelp.tmpl')->process({helpMessage => 'help text here'});
print $q->template('fileMonkeyMain.tmpl')->process({mainmessage => "session info: <br> name: ".$q->session->data->name . "<br> time: ".$q->session->data->time});
print $q->template('footer1.tmpl')->process({version => $q->lazyversion});
=head1 DESCRIPTION
CGI::Lazy was designed to simply abstract some of the more common cgi scripting tasks because the author finally got sick of writing the same code by hand for every new site or client that comes along. It is my attempt to extend the wonderful CGI.pm...
There are plenty of webdev frameworks out there, many are far more full- featured. Often these solutions are so monstrous that they are overkill for small apps, or so optimized that they require full admin rights on the server they run on. CGI::Laz...
Lazy has also been written to be useful in a mod_perl environment if that is your pleasure. The wonders of persistence and namespaces have been (again, hopefully) all accounted for. It should plug into your mod_perl environment with little or no fu...
For the most part, CGI::Lazy is simply a subclass of CGI::Pretty, which is an easier to read version of CGI.pm.
We need to use CGI::Pretty due to a css issue in IE where the style definitions aren't always followed unless there is the appropriate amount of whitespace between html tags. Luckilly, CGI::Pretty takes care of this pretty transparently, and its out...
CGI::Lazy adds a bunch of hooks in the interest of not working any harder than we need to, otherwise it's a CGI::Pretty object.
Probably 80% of the apps the author has been asked to write have been front ends to some sort of database, so that's definitely the angle Lazy is coming from. It works just fine with no db, but most of the fancy work is unavailable.
Output to the web is intended to be through templates via HTML::Template. However, if you want to write your content into the code manually, we won't stop you. Again, the whole point was to be flexible and reusable, and to spend our time writing ne...
The CGI::Lazy::Widget::Dataset module especially was written to bring spreadsheet-like access to a database table to the web in a fairly transparent manner- after all, most of the time you're doing one of 4 operations on a database: select, insert, u...
In any event, it is my hope that this is useful to you. It has saved me quite alot of work. I hope that it can do the same for you. Bug reports and comments are always welcome.
=head1 METHODS
=head2 authn ()
Returns authentication object
=head2 authz ()
Returns authorization object
=head2 config ()
Method retrieves CGI::Lazy::Config object for configuration variable retrieval
See CGI::Lazy::Config for details
=head2 db ()
Method retrieves the database object CGI::Lazy::DB. The db object contains convenience methods for database access, and will contain the default database handle for the object.
=head2 dbh ()
Retrieves dbh from db object for use in cgi. Convenience method. Same as $q->db->dbh.
=head2 errorHandler ()
Returns the CGI::Lazy::ErrorHandler object. ErrorHandler contains convenience methods for trapping and returning error codes without generating a pesky 500 error.
=head2 header (args)
Creates standard http header. Passes all arguments to CGI::Pretty::header, simply adding our own goodness to it in passing.
=head3 args
normal header args
=head2 javascript ( )
returns CGI::Lazy::Javascript object.
see CGI::Lazy::Javascript for details.
=head2 jswrap ( script )
Wraps javascript text in script tags and html comments for output to the browser. Pretty much the same as $q->script, but it comment wraps the script contents.
=head3 script
javascript text to output to the browser.
=head2 mod_perl ()
Returns mod_perl object if plugin is enabled.
( run in 1.147 second using v1.01-cache-2.11-cpan-5735350b133 )