BingoX::Cobalt - Cobalt display parent class containing generic methods
use BingoX::Cobalt;
# $BR - Blessed Reference # $SV - Scalar Value # @AV - Array Value # $HR - Hash Ref # $AR - Array Ref # $SR - Stream Ref # $proto - BingoX::Cobalt object OR sub-class # $object - BingoX::Cobalt object
CONSTRUCTORS
$BR = $proto->new( [ $app, $dbh, ] $data_object ); $BR = $proto->get( [ $dbh, ] \%params );
STREAM CONSTRUCTOR METHODS
$SR = $proto->stream_obj( $app [, $dbh, ] @_ ); $SR = $proto->stream_hash( [ $dbh, ] @_ ); $SR = $proto->stream_array( [ $dbh, ] @_ );
LIST CONSTRUCTOR METHODS
$AR = $proto->list_obj( $app [, $dbh, ] @_ ); $AR = $proto->list_hash( [ $dbh, ] @_ ); $AR = $proto->list_array( [ $dbh, ] @_ );
RELATION METHODS
$SR = $object->stream_related( $rel_display_class [, \@fields] [, \@sort] [, $unary_rev_flag ] ); $AR = $object->list_related( $rel_display_class [, \@fields] [, \@sort] [, $unary_rev_flag ] );
OBJECT METHODS
$BR = $object->db_obj( ); $BR = $object->dbh( ); $BR = $object->app( ); $BR = $proto->r( ); $BR = $proto->cgi( ); $BR = $proto->conf( );
PARSER METHODS
$SV = $object->include( @_ ); $SV = $object->xinclude( @_ );
CLASS DATA ACCESSOR METHODS
$SV = $proto->data_class( ); $HR = $proto->display_fields( ); $AR = $proto->display_order( );
BingoX::Time, CGI, Carp, strict
Nothing
Cobalt provides the generic API for BingoX display classes. Cobalt uses display objects that wrap Carbon data objects (Cobalt mono Carbide?).
Classes that inherit from Cobalt should have the following class variables:
@display_order
The order in which to display fields (if one so chose to display them ;)
$data_class
The name of the data class that corresponds to the display class. If this value is not defined, it will default to the name of the display class, with the first instance of "::Display::" changed to "::Data::".
%display_fields
A total mystery. If this variable is not defined, eack key is an field from the @display_order variable, and each value is 1.
new
Given a data object, returns a Display object of the class it was called as. This means you could concievably provide a data object of a totally inapproriate type, and this method will not compain about it.
get
Returns a display object.
stream_obj
Returns an stream (CODE ref) that will return objects (See list_obj) If you don't know how to use streams, use list_obj() instead.
stream_hash
Forwards to $class->data_class->stream_hash
stream_array
Forwards to $class->data_class->stream_array
list_obj
Returns an array ref of Display objects. Used mainly by Apache::XPP (the BingoX default parser) coders. Everyone else is probably using $self->data_class->list_obj().
list_hash
Forwards to $class->data_class->list_hash
list_array
Forwards to $class->data_class->list_array
show_obj
Behaves just like list_obj() or stream_obj() but will xinclude each object in a passed $template. Normally called by AUTOLOAD (via a show_* call), but you can call it explicitly if you like. Pass $app and $dbh if it's called statically.
stream_related
Returns a stream of related display objects from the $rel_display_class class.
Returns an array ref of related display objects from the $rel_display_class class.
db_obj
Returns the Data object for the Display Class that it was called from, with the constraint being: map $q->param( $_ ) @{ $data_class->primary_keys }
hour_menu
Returns a Popup Menu with Hours.
min_menu
Returns a Popup Menu with Minutes.
am_pm_menu
Returns a Popup Menu with AM/PM menus.
day_menu
Returns a Popup Menu with the Days of the Month.
month_menu
Returns a Popup Menu with the Months of the Year.
year_menu
Returns a Popup Menu with a list of Years up to 20 years from now.
errors_list
Returns list of errors in list format.
alink
Returns a hyper link with the params passed to it, -HREF, -JAVASCRIPT.
submit
Returns a Submit Button with the params passed to it, -NAME, -VALUE, -JAVASCRIPT.
image_button
Returns a hyper link with the params passed to it, -HREF, -SRC, -BORDER, -ALT, -JAVASCRIPT.
textfield
Returns a Text Field with the params passed to it, -VALUE, -SIZE, -OVERRIDE.
hidden
Returns a Hidden Field with the params passed to it, -VALUE.
popup_menu
Returns a Popup Menu with the params passed to it, -VALUES, -LABELS, -OVERRIDE.
checkbox
Returns a Checkbox with the params passed to it, -VALUE, -LABEL, -OVERRIDE.
checkbox_group
Returns a Checkbox Button Group with the params passed to it, -VALUES, -LABELS, OVERRIDE.
radio_group
Returns a Radio Button Group with the params passed to it, -NAME, -VALUES, -LABELS, -DEFAULT, -OVERRIDE.
get_default
Gets the default value for the field name requested.
app
Returns the object's Application Object.
dbh
Returns the object's database handle.
r
Returns Apache Request object.
cgi
Returns the display object's internal CGI object (or makes a new one)
conf
Returns the conf object.
date
Returns the display object's internal date object (or makes a new one)
include
Forwards to $app->include
xinclude
Forwards to $app->xinclude
adminuri
Returns class defined URI as a string.
data_class
Returns the data class for the current display class (from the class variable $data_class).
display_fields
Returns the class variable %{"${class}::display_fields"} as a hash reference.
display_order
Returns the class variable @{"${class}::display_order"} as an array reference.
title_field
Returns the title field for the current display class (from the class variable data_class).
date_fields
Returns the date fields for the current display class (from the class variable data_class).
content_fields
Returns the content fields for the current display class (from the class variable data_class).
relations
Returns the relations for the current display class (from the class variable data_class).
primary_keys
Returns the primary keys for the current display class (from the class variable data_class).
foreign_keys
Returns the foreign keys for the current display class (from the class variable data_class).
cpkey
Returns the cpkey for the current display class (from the class variable db_obj).
2 POD Errors
The following errors were encountered while parsing the POD:
=over without closing =back
'=end private api' is invalid. (Stack: =over; =begin private)
To install BingoX::Time, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BingoX::Time
CPAN shell
perl -MCPAN -e shell install BingoX::Time
For more information on module installation, please visit the detailed CPAN module installation guide.