-
-
Save bimmerlabs/f3f3842bab444c20ef398b8e7ea80737 to your computer and use it in GitHub Desktop.
users route
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/users' => sub { | |
my $self = shift; | |
my (%users, $count) = MyApp::Model::Users::list_users($self); | |
$self->stash(users => \%users, count => $count); | |
$self->render(template => 'users'); | |
}; | |
# in the template (none of these work): | |
@@ users.html.ep | |
% my %users = %{$users}; | |
% my $usercount = 1; | |
% until ($usercount > $count) { | |
<td><%= $usercount %></td> | |
<td><%= $users{$usercount}{'name'} %></td> | |
<td><%= $users{$usercount}->{'name'} %></td> | |
<td><%= $users->{$usercount}->{'name'} %></td> | |
% $usercount++; | |
% } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment