% use Mojo::ByteStream qw/b/; This is the page for <%= $tab %> for <%= $object %> <%= $key %>.
get '/<%= $object %>/<%= $tab %>/*key' => sub {
% if ($self->app->routes->namespace) {
    # or define <%= $self->app->routes->namespace %>::<%= b($object)->camelize %>::<%= $tab %>()
% }
    ...
} => '<%= $object %>/<%= $tab %>';

# templates/<%= $object %>/<%= $tab %>.html.ep
This is the page for
<%= $tab %> for <%= $object %>
<%= $<%= $object %>->key %>