-sub _args {
- my ($self, $r) = @_;
- my $class = $r->model_class;
- my %args = (
- request => $r,
- objects => $r->objects,
- base => $r->config->{uri_base},
- config => $r->config
- # ...
- ) ;
- if ($class) {
- $args{classmetadata} = {
- name => $class,
- columns => [ $class->display_columns ],
- colnames => { $class->column_names },
- related_accessors => [ $class->related($r) ],
- moniker => $class->moniker,
- plural => $class->plural_moniker,
- cgi => { $class->to_cgi },
- description => $class->description
- };
-
- # User-friendliness facility for custom template writers.
- if (@{$r->objects || []} > 1) {
- $args{$r->model_class->plural_moniker} = $r->objects;
- } else {
- ($args{$r->model_class->moniker}) = @{$r->objects ||[]};
- }
- }
+ my $template_file = $r->template;
+ my $ext = $r->config->template_extension;
+ $template_file .= $ext if defined $ext;