Apache2::Controller::Dispatch::HashTree

Hash tree dispatch for Apache2::Controller::Dispatch
Download

Apache2::Controller::Dispatch::HashTree Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Mark Hedges
  • Publisher web site:
  • http://search.cpan.org/~markle/

Apache2::Controller::Dispatch::HashTree Tags


Apache2::Controller::Dispatch::HashTree Description

Hash tree dispatch for Apache2::Controller::Dispatch Apache2::Controller::Dispatch::HashTree is a Perl module that implements find_controller() for Apache2::Controller::Dispatch with a simple hash-based mapping. Uses substr to divide the uri and exists to check cached mappings, so it should be pretty fast.SYNOPSIS < Location "/subdir" > SetHandler modperl PerlInitHandler MyApp::Dispatch < /Location > # lib/MyApp::Dispatch: package MyApp::Dispatch; use base qw( Apache2::Controller::Dispatch::HashTree ); # return a hash reference from dispach_map() sub dispatch_map { return { foo => { default => 'MyApp::C::Foo', bar => { biz => 'MyApp::C::Biz', baz => 'MyApp::C::Baz', }, }, default => 'MyApp::C::Default', } } 1; __END__This maps uri's to controller modules as follows: /subdir/foo MyApp::C::Foo->default() /subdir/foo/bar MyApp::C::Foo->bar() /subdir/foo/bar/zerm MyApp::C::Foo->bar(), path_args == /subdir/foo/bar/biz MyApp::C::Biz->default() /subdir/foo/biz/baz/noz/wiz MyApp::C::Baz->noz(), path_args == In the second example, if < MyApp::C::Foo > did not implement or allow < bar() > as a controller method, then this would select < MyApp::C::Foo-default() >>. Requirements: · Perl


Apache2::Controller::Dispatch::HashTree Related Software