Derek Wueppelmann
and 1 contributors

NAME

CatalystX::NavigationMenuItem

SYNOPSIS

  my $mi = CatalystX::NavigationMenuItem->new(
        ...
  );

  my $entry = $mi->nav_entry($c);
  my $link = $mi->get_link($c);

DESCRIPTION

CatalystX::NavigationMenuItem represents a menu item in a L(CatalystX::NavigationMenu). This object does all the work of determining if the menu item can be displayed, what link to use and if there are sub menus.

METHODS

contains_path($path)

Returns true if this menu item or any of its children contain the given path.

Returns a hash reference that contains the navigation entry for this item. If there is no link associated with item it will return an undef value. If $with_subs is true then the sub navigation to this item is also include in the hash with a key of: subnav. The other keys are:

label

The label to use for the actual link. The text to show between a tags.

title

An optional title of the link. To be used as the title attribute of the a tag.

The actual link. This contains the actual URI string, not an object.

active

True if the given entry is currently active (part of the path to the currently viewed page).

add_item($item)

Add the given item to the sub tree for this item. If no subtree exists create one.

get_link($c)

Using the given Catalyst object determine if this link should be displayed or not. It will use the Catalyst object to fill in any missing values it needs to complete an action link, it will also use the object to determine any conditions that require it.

DEPENDENCIES

Catalyst

SEE ALSO

CatalystX::NavigationMenu

AUTHORS

Derek Wueppelmann <derek@roaringpenguin.com>

LICENSE AND COPYRIGHT

Copyright (c) 2011 Roaring Penguin Software, Inc.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.