YanoRyuichi.com/
Wiki
Blog
GitHub
Sandbox
開始行:
* テンプレート内でのURLの書き方 [#i1c6de9c]
** uri_for() [#yf810e5a]
テンプレートファイルで以下のように記述する。user_name=XXX...
[% Catalyst.uri_for('/login',{user_name => user.user_nam...
URLを/で区切りたい場合は、以下のようにする。(http://xxx/...
[% Catalyst.uri_for('/login',user.user_name) %]
これをアクションクラスでは以下のようにして受け取る。
sub login : Local {
my ($self, $c, $user_name) = @_;
}
** uri_with() [#u3452b2c]
検索結果表示画面でのページングなどで、パラメータ付きのURL...
<a href="[% uri_with({page_no =>1})%]">前のページ</a> |
<a href="[% uri_with({page_no =>3})%]">次のページ</a>
すると、下のようなURLが組み立てられる。
<a href="http://xxx/search?date=20070401&page_no=1"> |
<a href="http://xxx/search?date=20070401&page_no=3">
終了行:
* テンプレート内でのURLの書き方 [#i1c6de9c]
** uri_for() [#yf810e5a]
テンプレートファイルで以下のように記述する。user_name=XXX...
[% Catalyst.uri_for('/login',{user_name => user.user_nam...
URLを/で区切りたい場合は、以下のようにする。(http://xxx/...
[% Catalyst.uri_for('/login',user.user_name) %]
これをアクションクラスでは以下のようにして受け取る。
sub login : Local {
my ($self, $c, $user_name) = @_;
}
** uri_with() [#u3452b2c]
検索結果表示画面でのページングなどで、パラメータ付きのURL...
<a href="[% uri_with({page_no =>1})%]">前のページ</a> |
<a href="[% uri_with({page_no =>3})%]">次のページ</a>
すると、下のようなURLが組み立てられる。
<a href="http://xxx/search?date=20070401&page_no=1"> |
<a href="http://xxx/search?date=20070401&page_no=3">
ページ名: