NAME

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

SYNOPSIS

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

plugin 'toto' =>
   path => "/toto",
   namespace => "Beer",
   menu => [
       beer    => { one  => [qw/ingredients pubs/],
                    many => [qw/search browse/] },
       brewery => { one  => [qw/directions beers info/],
                    many => [qw/phonelist mailing_list/] },
       pub     => { one  => [qw/info comments/],
                    many => [qw/search map/] },
#  $controller (object) => { one => [ ..actions on one object ],
#                          many => [ ..actions on 0 or many objects ]
   ]
;

get '/my/url/to/search/for/beers' => sub {
     shift->render_text("here is my awesome beer search page");
} => "beer/search";

app->start

./Beer daemon

DESCRIPTION

This is an implementation of a navigational structure called "toto": "tabs on this object" which is as follows :

Given a collection of objects (e.g. beers, breweries, pubs), come up with two types of pages :

- pages associated with one object (e.g. view, edit)

- pages associated with zero or more than one object (e.g. search, browse)

Then Toto refers to a screen with three types of tab lists :

- a list of all the objects

- a list of all the actions possible on one object

- a list of all the actions possible on zero or multiple objects

After creating a structure, as in the synopsis, and starting a mojolicious app, there will be a site as well as sample code and sample objects.

Route names of the form "controller/action" will automatically be placed into the toto navigational structure.

Controller classes may also be used; they will be automatically called if they exist (e.g. "Beer::Pub::search()").

A template for a given page may be in either of these two places :

templates/$controller/$action.html.ep
templates/$action.html.ep

TODO

much more documentation