Changeset 23 in bookmarks


Ignore:
Timestamp:
05/22/13 21:12:00 (11 years ago)
Author:
peter
Message:

use the subclass style of CGI::Application::Dispatch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.cgi

    r9 r23  
    55# javascript:(function(){window.open("http://grim.ath.cx/~peter/bookmarks?uri="+document.location+"&title="+document.title,"edit_bookmark","width=800,height=250")})() 
    66 
    7 use CGI::Application::Dispatch; 
    8 CGI::Application::Dispatch->dispatch( 
    9     table => [ 
    10         '[get]'              => { app => 'BookmarkApp', rm => 'list' }, 
    11         'list[get]'          => { app => 'BookmarkApp', rm => 'list' }, 
    12         'feed[get]'          => { app => 'BookmarkApp', rm => 'feed' }, 
    13         ':id/:field?[get]'   => { app => 'BookmarkApp', rm => 'view' }, 
    14         ':id?[post]'         => { app => 'BookmarkApp', rm => 'edit' }, 
    15     ], 
    16 ); 
     7package BookmarkApp::Dispatch; 
     8use base 'CGI::Application::Dispatch'; 
     9 
     10sub dispatch_args { 
     11    return { 
     12        table => [ 
     13            '[get]'              => { app => 'BookmarkApp', rm => 'list' }, 
     14            'list[get]'          => { app => 'BookmarkApp', rm => 'list' }, 
     15            'feed[get]'          => { app => 'BookmarkApp', rm => 'feed' }, 
     16            ':id/:field?[get]'   => { app => 'BookmarkApp', rm => 'view' }, 
     17            ':id?[post]'         => { app => 'BookmarkApp', rm => 'edit' }, 
     18        ], 
     19    }; 
     20} 
     21 
     22package main; 
     23BookmarkApp::Dispatch->dispatch(); 
Note: See TracChangeset for help on using the changeset viewer.