The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mojolicious::Plugin::Toto - A simple tab and object based site structure

SYNOPSIS

 cat > ./Beer
 #!/usr/bin/env perl
 use Mojolicious::Lite;

 get '/my/url/to/list/beers' => sub {
      shift->render_text("Here is a page for listing beers.");
 } => "beer/list";

 get '/beer/create' => sub {
    shift->render_text("Here is a page to create a beer.");
 } => "beer/create";

 plugin 'toto' =>
    menu => [
        beer    => { one  => [qw/view edit pictures notes/],
                     many => [qw/list create search browse/] },
        brewery => { one  => [qw/view edit directions beers info/],
                     many => [qw/phonelist mailing_list/] },
        pub     => { one  => [qw/view info comments hours/],
                     many => [qw/search map/] },
    ]
 ;

 app->start

 ./Beer daemon

DESCRIPTION

This plugin provides a navigational structure for a Mojolicious or Mojolicious::Lite app.

It provides a menu for changing between types of objects, and it provides rows of tabs which correspond to actions.

It extends the idea of BREAD or CRUD -- in a BREAD application, browse and add are operations on aggregate (0 or many) objects, while edit, add, and delete are operations on 1 object.

Toto groups all pages into two categories : either they act on one object, or they act on 0 or many objects.

A rows of tabs is displayed which shows other actions. The actions in the row depend on context -- the type of object, and whether or not an object is selected.

A second row of tabs on the left shows all possible object types.

A data structure is used to configure the navigational structure. This data structure should describe the types of objects as well as the possible actions.

For Mojolicious::Lite apps, routes whose names are of the form "controller/action" will automatically be placed into the navigational structure. Note that each "controller" corresponds to one "object".

For Mojolicious (not lite) apps, methods in controller classes will be used if they exist.

Styling is done (mostly) with jquery css.