trillbox 0.03
Sponsored Links
trillbox 0.03 Ranking & Summary
File size:
0.010 MB
Platform:
Any Platform
License:
BSD License
Price:
Downloads:
884
Date added:
2007-05-25
Publisher:
James Robson
trillbox 0.03 description
trillbox is a flexible and extendable toolkit for building dynamic Web pages.
Written in Perl and based on Template::Recall, it provides "widgets" (or controls) that you can quickly integrate into your Perl Web application. trillbox widgets are designed to be independent points of control that can be easily plugged into a Web programming system, e.g. a CGI application, template-based, or included as part of an application framework.
Widgets purposely have no direct knowledge of each other in order to offer the greatest flexibility (although they may be designed so that output and input can be piped between widgets).
trillbox adds easy, "pluggable" components to your web application. By way of introduction, we will step through a simple CGI application that uses the Trillbox::DataTable component to output data from a table in a MySql database. We will start simple and get progressively more complex as we go.
Here is the script
#!C:/zangweb/perl/bin/perl.exe
use CGI qw(:standard);
use DBI;
# Load our TR widgets from here
use lib ../../;
use Trillbox::DataTable;
print header;
print start_html;
print "< h2 >Trillbox::DataTable demo< /h2 >";
my $dbh = DBI->connect(
"DBI:mysql:database=test;host=localhost", "root", "", {RaiseError => 1}
);
my $dt = Trillbox::DataTable->new();
$dt->set( table_attrs => border="1" );
$dt->set( colnames => [ ID,Product,Price ] );
# Connect DBI output to DataTable:
$dt->set(
bind_data => $dbh->selectall_arrayref("select * from trillbox_intro")
);
$dbh->disconnect();
# Output the data
print $dt->output();
print end_html;
Notice the statement
use lib ../../;
prior to use Trillbox::DataTable;. This instructs our script that we will find the trillbox components two directories above the location of the script. After this line of code, you can add any component you like simply with
use Trillbox::Component;
You may download and put trillbox in any location that is appropriate. The use lib path statement tells your code where the components may be found. This allows you to run trillbox on servers that may not have the dependent modules installed.
This is a standard CGI script, so we do the usual things like print header, and print start_html. Using DBI, we connect to a MySql server, in this case, one running on our workstation.
Then, we instantiate the Trillbox::DataTable object via its new() method. No parameters need to be passed to new(). You set properties on the object using the set() method. In the following statement, we set the attributes of the produced by $dt so that it has a border.
We use set() again, this time to set the column header names of the table. set() expects one or more name/value pairs. In this case, colnames is the property name, and the anonymous array represents the column header values.
set() is probably the most overworked method of the Trillbox core components. We now use it to set the bind_data property of $dt to the output from the DBI object. You can see that we pass our SQL statement into the $dbh->selectall_arrayref() method, and it returns a reference to an array, which is exactly what bind_data expects. Any array in your code can be "bound" to DataTable by passing a reference to it. (Note that it expects a 2-dimensional array, that is, an array of arrays.)
Whats Newin This Release:
- Added Treeview widget.
- Build nested structures of nodes, like a file system directory tree.
Written in Perl and based on Template::Recall, it provides "widgets" (or controls) that you can quickly integrate into your Perl Web application. trillbox widgets are designed to be independent points of control that can be easily plugged into a Web programming system, e.g. a CGI application, template-based, or included as part of an application framework.
Widgets purposely have no direct knowledge of each other in order to offer the greatest flexibility (although they may be designed so that output and input can be piped between widgets).
trillbox adds easy, "pluggable" components to your web application. By way of introduction, we will step through a simple CGI application that uses the Trillbox::DataTable component to output data from a table in a MySql database. We will start simple and get progressively more complex as we go.
Here is the script
#!C:/zangweb/perl/bin/perl.exe
use CGI qw(:standard);
use DBI;
# Load our TR widgets from here
use lib ../../;
use Trillbox::DataTable;
print header;
print start_html;
print "< h2 >Trillbox::DataTable demo< /h2 >";
my $dbh = DBI->connect(
"DBI:mysql:database=test;host=localhost", "root", "", {RaiseError => 1}
);
my $dt = Trillbox::DataTable->new();
$dt->set( table_attrs => border="1" );
$dt->set( colnames => [ ID,Product,Price ] );
# Connect DBI output to DataTable:
$dt->set(
bind_data => $dbh->selectall_arrayref("select * from trillbox_intro")
);
$dbh->disconnect();
# Output the data
print $dt->output();
print end_html;
Notice the statement
use lib ../../;
prior to use Trillbox::DataTable;. This instructs our script that we will find the trillbox components two directories above the location of the script. After this line of code, you can add any component you like simply with
use Trillbox::Component;
You may download and put trillbox in any location that is appropriate. The use lib path statement tells your code where the components may be found. This allows you to run trillbox on servers that may not have the dependent modules installed.
This is a standard CGI script, so we do the usual things like print header, and print start_html. Using DBI, we connect to a MySql server, in this case, one running on our workstation.
Then, we instantiate the Trillbox::DataTable object via its new() method. No parameters need to be passed to new(). You set properties on the object using the set() method. In the following statement, we set the attributes of the produced by $dt so that it has a border.
We use set() again, this time to set the column header names of the table. set() expects one or more name/value pairs. In this case, colnames is the property name, and the anonymous array represents the column header values.
set() is probably the most overworked method of the Trillbox core components. We now use it to set the bind_data property of $dt to the output from the DBI object. You can see that we pass our SQL statement into the $dbh->selectall_arrayref() method, and it returns a reference to an array, which is exactly what bind_data expects. Any array in your code can be "bound" to DataTable by passing a reference to it. (Note that it expects a 2-dimensional array, that is, an array of arrays.)
Whats Newin This Release:
- Added Treeview widget.
- Build nested structures of nodes, like a file system directory tree.
trillbox 0.03 Screenshot
trillbox 0.03 Keywords
DataTable
DBI
CGI
building dynamic web pages
building dynamic web
Dynamic Web pages
for building
Dynamic Web
Building Dynamic
trillbox
web
print
output
array
application
trillbox 0.03
Bookmark trillbox 0.03
trillbox 0.03 Copyright
WareSeeker periodically updates pricing and software information of trillbox 0.03 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of trillbox 0.03 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
building dynamic web pages php
building dynamic web pages with dreamweaver
building dynamic websites
javascript your visual blueprint for building dynamic web pages
explain static and dynamic web pages
dynamic web page examples
building dynamic website
static and dynamic web pages
building dynamic web 2.0 websites with ruby on rails
dynamic web pages php
creating dynamic web pages
building dynamic web content
c# datatable
javascript your visual blueprint for building dynamic web pages 2nd edition
dynamic web pages with php
create dynamic web pages
building dynamic website with dreamweaver
building dynamic web databases
Version History
Related Software
Siren is a music player for GNOME with an extremely minimalist interface. Free Download
PerlIO::locale is a PerlIO layer to use the encoding of the current locale. Free Download
Net::CSTA project is a perl-module for talking to an ECMA CSTA Phase I server. Free Download
CGI::MxScreen is a multi-screen stateful CGI framework. Free Download
Crikey is a program to generate key events under X11. Free Download
CGILua is a tool for developing dynamic Web pages using Lua. Free Download
Prince is a batch formatter for converting XML into PDF by applying Cascading Style Sheets (CSS). Free Download
List::RewriteElements is a Perl module that can create a new list by rewriting elements of a first list. Free Download
Latest Software
Popular Software
Favourite Software