DESCRIPTION

This plugin provides a navigational structure and a default set of routes for a Mojolicious or Mojolicious::Lite app

The navigational structure is a slight variation of this example used by twitter's bootstrap.

The plugin provides a sidebar, a nav bar, and also a row of tabs underneath the name of an object.

The row of tabs is an extension of BREAD or CRUD -- in a BREAD application, browse and add are operations on zero or many objects, while edit, add, and delete are operations on one object. In the toto structure, these two types of operations are distinguished by placing the former in the side nav bar, and the latter in a row of tabs underneath the object to which the action applies.

Additionally, a top nav bar contains menu items to take the user to a particular side bar.

HOW DOES IT WORK

After loading the toto plugin, the default layout is set to 'toto'.

Defaults routes are generated for every sidebar entry and tab entry.

The names of the routes are of the form "controller/action", where controller is both the controller class and the model class.

The following templates will be automagically used, if found (in order of preference) :

OPTIONS

In addition to "menu", "nav/sidebar/tabs", the following options are recognized :

prefix

prefix => /my/subpath

A prefix to prepend to the path for the toto routes.

head_route

head_route => $app->routes->find('top_route");

A Mojolicious::Route::Route object to use as the parent for all routes.

model_namespace

model_namespace => "Myapp::Model'

A namespace for model classes : the model class will be camelized and appended to this.

EXAMPLE

There are two different structures that toto will accept. One is intended for a simple CRUD structure, where each object has its own top level navigational item and a variety of possible actions. The other form is intended for a more complex situation in which the list of objects does not correspond to the list of choices in the navigation bar.

Simple structure

The "menu" format can be used to automatically generate the nav bar, side bar and rows of tabs, using actions which correspond to many objects or actions which correspond to one object.