From 78ca407e1a819f514cbb45f0dbd085411066ab54 Mon Sep 17 00:00:00 2001 From: Aaron Trevena Date: Fri, 23 Jun 2006 10:47:56 +0000 Subject: [PATCH] fixed index action, you can now over-ride it, but otherwise it just calls list git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@499 48953598-375a-da11-a14b-00016c27c3ee --- MANIFEST | 1 + lib/Maypole.pm | 3 +-- lib/Maypole/Model/Base.pm | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/MANIFEST b/MANIFEST index a6810df..5453207 100644 --- a/MANIFEST +++ b/MANIFEST @@ -5,6 +5,7 @@ ex/BeerDB/Beer.pm ex/beerdb.sql lib/Apache/MVC.pm lib/CGI/Maypole.pm +lib/CGI/Untaint/Maypole.pm lib/Maypole.pm lib/Maypole/Application.pm lib/Maypole/CLI.pm diff --git a/lib/Maypole.pm b/lib/Maypole.pm index 19e9cec..02ecade 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -983,13 +983,12 @@ properties. Calls C before parsing path and setting properties. sub parse_path { my ($self) = @_; - + # Previous versions unconditionally set table, action and args to whatever # was in @pi (or else to defaults, if @pi is empty). # Adding preprocess_path(), and then setting table, action and args # conditionally, broke lots of tests, hence this: $self->$_(undef) for qw/action table args/; - $self->preprocess_path; $self->path || $self->path('frontpage'); diff --git a/lib/Maypole/Model/Base.pm b/lib/Maypole/Model/Base.pm index de33ac9..d5d325c 100644 --- a/lib/Maypole/Model/Base.pm +++ b/lib/Maypole/Model/Base.pm @@ -133,6 +133,9 @@ Empty Action. Empty Action. +=item index + +Empty Action, calls list if provided with a table. =back @@ -148,6 +151,14 @@ sub view : Exported { sub edit : Exported { } +sub index : Exported { + my ( $self, $r ) = @_; + if ($r->table) { + $r->template("list"); + return $self->list($r); + } +} + =pod Also, see the exported commands in C. -- 2.39.2