Gluu fer the Wëëbb Part 3

There is always more than one way to do something in perl and Toto definitely lives up to that old adage.

When I first started I simply aped what was on the POD so my set up was like this

plugin 'toto' =>
        nav => [ qw{character} ],
        sidebar => {
            character => [ qw{character/list character/search character} ],
        tabs => {
            character=> [qw/view edit delete/],

which is fine but a doing a little more sniffing about inside the guts of the mod and some of the examples I was able to figure out rather quickly I could get the same results with a different setup.

plugin toto => menu => [
   character => {
       many => [qw{list search create}],
       one => [qw{view update delete}],

which I actually like a little better than the first time I played with it.

As well I was able to clean up the code a bit as before I had this

get '/character/view/:name' => { nav_item => 'character\view' } => sub {

now I only need this

get '/character/view/:name' => { nav_item => 'character' } => sub {

Which to me looks much better so I am going to use that from now on.

Leave a comment

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations