View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
David R. Baird > MasonX-Maypole-0.215 > lib/templates/factory/maybe_link_view


Annotate this POD


New  1
Open  0
View/Report Bugs
Source   Latest Release: MasonX-Maypole-0.219


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.

This tests whether or not the returned value is an object, and if so, creates a link to a page viewing that object; if not, it just displays the text as normal. The object is linked using its stringified name; by default this calls the name method, or returns the object's ID if there is no name method or other stringification method defined.

</%doc> <%args> $object </%args> % if ( $object->isa( 'Maypole::Model::Base' ) { <& link, table => $object->table, command => "view", additional => $object->id, label => $object &> % } else { <% $object %> % }

syntax highlighting: