Drkcore

06 02 2007 catalyst Tweet

uri_with()って素敵

いまさらというか、よくわからない順番で発見または再発見があるのでCatalsytは素敵。

Journal of LTjake (4001)

uri_with lets you add new (or replace existing) key-value pairs in the current request's URL. The following Template Toolkit code shows you how to take a URL (eg. http://example.com/search/?q=foo) and append next and previous page numbers (eg. http://example.com/search/?q=foo&page=2). It assumes that you have a Data::Page object in a stash variable called "pager".

というわけで、uri_with()を使うと、現在のURIに新たなキー値を付加することができるということなんだそうだ(知らなかった)。

ページ処理とかはこれですっきりしそう。

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021