Router::Simple::SubMapper(3pm)

Router::Simple::SubMapper3pm

Submapper

Usage

    use Router::Simple;
    my $router = Router::Simple->new();
    my $s = $router->submapper('/entry/{id}', {controller => 'Entry'});
    $s->connect('/edit' => {action => 'edit'})
      ->connect('/show' => {action => 'show'});

Overview

Router::Simple::SubMapper is sub-mapper for Router::Simple. This class provides shorthand to create routes, that have common parts.

Methods

my $submapper = $router->submapper(%args);

Do not call this method directly.You should create new instance from $router->submapper(%args).

$submapper->connect(@args)

This method creates new route to parent $router with @args and arguments of ->submapper().

This method returns $submapper itself for method-chain.

$submapper->submapper(%args)

submapper() can be called recursively to build nested routes.

This method returns $submapper itself for method-chain.

Releases

7 releases since Debian 7 (Wheezy); the text changed 4 times.

  1. 7
  2. 8
  3. 9–10
  4. 11
  5. 12–13

From librouter-simple-perl 0.17-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.