in $r->params, or anything else, is DEPRECATED and likely to break in future
releases. Be good, and use proper method calls.
-Incompatible API changes:
- Maypole:
- - is_applicable() renamed to is_model_applicable(), and returns boolean
- instead of a status code. Old-style is_applicable() will still work,
- but issues a warning.
+ is_applicable() renamed to is_model_applicable(), and returns boolean
+ instead of a status code. Old-style is_applicable() will still work,
+ but issues a warning.
API additions and enhancements:
Maypole::Application:
- setup() split into setup(), setup_model(), and load_model_subclass()
- added new path processing methods for ssl and default table/action
- added make_path() and make_uri()
+ Templates:
+ - Improved pager macro/include
Bug fixes:
Fix to cgi_maypole.t (bug 11346)
@ISA directly, and doesn't inject itself into the chain (bugs 12923 & 14120)
Improved Template error reporting (14133)
Maypole::Session::generate_unique_id() now returns the id (bug 14124)
+ Implement -Init flag in Mp::Application (wishlist 14123)
+ add() alias to push() in Mp::Headers (wishlist 14142)
Moved ar accessor to Apache::MVC (bug 14014)
Refactored core to support further development in 2.11 and onwards
Fixed related_class method (bug 14566)
Maypole::Manual::About
- added Maypole::Manual::Inheritance
- added Maypole::Manual::Terminology
+ - updated Maypole::Manual::View
+ - updated Maypole::View:TT
.....
- [%# Template Toolkit directives and maypole macros go here %]
+ [% PROCESS macros %]
+
+ [% pager %]
+
+ [% link %]
+
+ [% maybe_link_view %]
=head1 DESCRIPTION
=head1 MAYPOLE MACROS AND FILTERS
-Maypole provides a collection of useful and powerful macros...TO DO
+Maypole provides a collection of useful and powerful macros in the templates/factory/macros
+ and other templates. These can be used in any template with [% PROCESS templatename %].
=head2 link
-=head2 other macros
+This creates an <A HREF="..."> to a command in the Apache::MVC system by
+catenating the base URL, table, command, and any arguments.
+
+=head2 maybe_link_view
+
+C<maybe_link_view> takes something returned from the database - either
+some ordinary data, or an object in a related class expanded by a
+has-a relationship. If it is an object, it constructs a link to the view
+command for that object. Otherwise, it just displays the data.
+
+=head2 pager
-=head2 finish this documentation
+This is an include template rather than a macro, and it controls the pager
+display at the bottom (by default) of the factory list and search views/template.
+It expects a C<pager> template argument which responds to the L<Data::Page> interface.
+
+This macro is in the pager template and used as :
+
+[% PROCESS pager %]
+
+Maypole provides a pager for list and search actions, otherwise you can
+provide a pager in the template using Template::Plugin::Pagination.
+
+[% USE pager = Pagination(objects, page.current, page.rows) %]
+...
+[% PROCESS pager %]
+
+The pager will use a the request action as the action in the url unless the
+pager_action variable is set, which it will use instead if available.
+
+=head2 other macros
=head1 AUTHOR
%]
<p class="pager">Pages:
[%
+ UNLESS pager_action;
+ SET pager_action = request.action;
+ END;
+
SET begin_page = pager.current_page - 10;
IF begin_page < 1;
SET begin_page = pager.first_page;
IF request.params.order;
SET args = args _ "&o2=desc"
IF request.params.o2 == "desc";
- SET action = "list";
FOR col = classmetadata.columns.list;
IF request.params.$col;
SET args = args _ "&" _ col _ "=" _ request.params.$col;
SET action = "search";
END;
END;
- link(classmetadata.table, action, args, label);
+ link(classmetadata.table, pager_action, args, label);
END;
END;
%]