1 |
package Frey::Web::Links; |
package Frey::ORM::Links; |
2 |
use Moose; |
use Moose; |
3 |
|
|
4 |
=head1 NAME |
=head1 NAME |
5 |
|
|
6 |
Frey::Web::Links - simple links to current page with one param |
Frey::ORM::Links - simple links to current page with one param |
7 |
|
|
8 |
=cut |
=cut |
9 |
|
|
37 |
default => ' ', |
default => ' ', |
38 |
); |
); |
39 |
|
|
40 |
|
has 'empty' => ( |
41 |
|
is => 'rw', |
42 |
|
isa => 'Str', |
43 |
|
default => '[empty]', |
44 |
|
); |
45 |
|
|
46 |
sub links { |
sub links { |
47 |
my $self = shift; |
my $self = shift; |
48 |
my @out = |
my @out = |
49 |
map { |
map { |
50 |
if ( $self->current eq $_ ) { |
if ( $_ eq '' ) { |
51 |
|
$self->empty |
52 |
|
} elsif ( $self->current eq $_ ) { |
53 |
'<' . $self->current_tag . '>' . $_ . '</' . $self->current_tag . '>' |
'<' . $self->current_tag . '>' . $_ . '</' . $self->current_tag . '>' |
54 |
} else { |
} else { |
55 |
qq|<a href="?| . $self->name . qq|=$_">$_</a>| |
qq|<a href="?| . $self->name . qq|=$_">$_</a>| |