-
-
07 Oct 2009 13:44:07 UTC
- Distribution: Template-Plugin-LinkTo
- Module version: 0.093
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (0)
- Testers (537 / 0 / 0)
- Kwalitee
Bus factor: 0- 96.77% Coverage
- License: unknown
- Activity
24 month- Tools
- Download (22.79KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Template
- Template::Plugin
- Template::Test
- URI::Escape
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Template::Plugin::LinkTo - like link_to in Ruby on Rails
SYNOPSIS
Input:
[% USE LinkTo -%] [% args = { href => '/link/to', } -%] [% LinkTo.link_to('link_text', args) %]
Output:
<a href="/link/to">link_text</a>
Input:
[% USE LinkTo -%] [% args = { href => '/link/to', hoge => 'huga', foo => 'bar', } -%] [% LinkTo.link_to('link_text', args) %]
Output:
<a href="/link/to?foo=bar&hoge=huga">link_text</a>
Input:
[% USE LinkTo -%] [% args = { href => '/link/to', hoge => 'huga', target => '_blank', } -%] [% LinkTo.link_to('link_text', args) %]
Output:
<a href="/link/to?hoge=huga" target="_blank">link_text</a>
Input:
[% USE LinkTo -%] [% args = { href => '/link/to', hoge => 'huga', target => '_blank', confirm => 'really ?', } -%] [% LinkTo.link_to('link_<br />a&b<br />"text"', args) %]
Output:
<a href="/link/to?hoge=huga" target="_blank" onclick="return confirm('really ?');">link_<br />a&b<br />"text"</a>
Input:
[% USE LinkTo -%] [% args = { } -%] [% LinkTo.link_to('link_text', args) %]
Output:
link_text
Sample with DBIx::Class::ResultSet
[% USE LinkTo -%] [%- WHILE (u = users.next) -%] [% args = { href => "user/${u.id}", hoge => 'huga', foo => 'bar', } -%] [% LinkTo.link_to(u.nickname, args) %] [%- END %]
DESCRIPTION
Template::Plugin::LinkTo is like link_to in Ruby on Rails, but NOT same at all.
SEE ALSO
AUTHOR
Tomoya Hirano, <hirafoo@cpan.org>
COPYRIGHT AND LICENSE
This library is free software; you can redistribute it and/or modify
Module Install Instructions
To install Template::Plugin::LinkTo, copy and paste the appropriate command in to your terminal.
cpanm Template::Plugin::LinkTo
perl -MCPAN -e shell install Template::Plugin::LinkTo
For more information on module installation, please visit the detailed CPAN module installation guide.