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.
maybe_link_view
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.
name
</%doc> <%args> $object </%args> % if ( UNIVERSAL::isa( $object, 'Maypole::Model::Base' ) ) { <& link, table => $object->table, command => "view", additional => $object->id, label => $object &> % } else { <% $object %> % }
To install MasonX::Maypole, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MasonX::Maypole
CPAN shell
perl -MCPAN -e shell install MasonX::Maypole
For more information on module installation, please visit the detailed CPAN module installation guide.