Advertisement
Guest User

Untitled

a guest
Mar 28th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.34 KB | None | 0 0
  1. # App.pm:
  2. $r->route('/page/:id')
  3.   ->name('page_show')
  4.   ->to( controller => 'page', action => 'show' );
  5.  
  6. # Page.pm:
  7. sub show {
  8.     my $c = shift;
  9.     warn 'has_data: '. $c->validation->has_data . ' id: ' . $c->param('id');
  10.     ...
  11. }
  12.  
  13. Request to "/page/99" prints:
  14. has_data:  id: 1 at /home/dan/uc2/script/../lib/App/Page.pm line 26.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement