Skip to content

Instantly share code, notes, and snippets.

@dhoss
Created July 23, 2010 18:36
Show Gist options
  • Save dhoss/487856 to your computer and use it in GitHub Desktop.
Save dhoss/487856 to your computer and use it in GitHub Desktop.
# example url: /dashboard/$charttype/$username/$style/$stats_for/$range/$days_months_or_years/$delimiter_day_week_or_month
# url i'm using: http://localhost:3000/dashboard/urmom/stats/months/3/daily/total/graph/subscribers
sub index : Local {
my ( $self, $c, $channel ) = @_;
my @args = @{$c->req->args};
$c->log->debug("Args: " . @args);
my $display = shift @args || 'graph';
my $style = shift @args || 'incr';
my $stat = shift @args || 'subscribers';
my $len = shift @args || 2;
my $range = shift @args || 'weeks';
my $division = shift @args || 'daily';
$c->forward('/chart/build_chart', [$display, $channel, $style, $stat, $len, $range, $division]);
$c->stash( template => 'dashboard/index.tt',
dashboard => {
channel => $channel,
range => $range,
length => $len,
division => $division,
style => $style,
display => $display,
stat => $stat,
},
);
}
## error: Couldn't render template "file error - dashboard.tt: not found"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment