One of the most commonly used controller keywords, controls_table must be the name of a table block in the same bigtop file. This adds a use statement for the table's model and provides the link between controller methods and the underlying table. This affects things like column labels on main listings, HTML form input element labels, etc.
controls_table
table
Build the example with:
bigtop -c example.bigtop all
Look in lib/Kids/Child.pm to see
lib/Kids/Child.pm
use Kids::Model::child qw( $CHILD ); #... sub get_model_name { return $CHILD; }
The model use statement is repeated in lib/Kids/GEN/Child.pm from which Kids::Child inherits. To see side affects of controls_table, look in the generated do_main:
lib/Kids/GEN/Child.pm
Kids::Child
do_main
my $retval = { headings => [ 'Name', 'Birth Day', ], };
The Name and Birth Day labels were taken from the label statements of fields blocks in the childtable, because they were listed in the cols statement.
Name
Birth Day
label
child
cols
Other similar magic happens because of controls_table.
To install Bigtop, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bigtop
CPAN shell
perl -MCPAN -e shell install Bigtop
For more information on module installation, please visit the detailed CPAN module installation guide.