2018-06-14から1日間の記事一覧

エントリを使う処理の書き方

sub capture_entry :Chained('/') :PathPart('') :CaptureArgs(1) { my ( $self, $c, $entry_id ) = @_; if (my $entry = $c->model('DB::Hoge')->find($entry_id)) { $c->stash->{entry} = $entry; } else { $c->stash->{template} = 'not_found.tt'; } } s…