textproc/p5-Catalyst-View-TT-FunctionGenerator 0.02p0 OpenBSD
use shorter names in catalyst tt views (deprecated)
- System
- OpenBSD
- Repository
- OpenBSD ports
- Maintainer
- The OpenBSD ports mailing-list <[email protected]>
- Categories
- textproc, devel, perl5
Description
This plugin should usually be invoked from an end action in your Application.
Call generate_functions to create the code references shortcuts to the methods used in the template toolkit view.
Then enjoy the shorter syntax.
For instance:
sub action : Local { my ( $self, $c ) = @_;
$c->view("ViewName")->generate\_functions('prototype');
\# OR
$c->view("ViewName")->generate\_functions($c->prototype);
\# OR
$c->view("ViewName")->generate\_functions(\[$c, 'uri\_for'\]);
}
# In your template, we can now have: [% link_to_remote("foo", { url => uri_for("blah") } ) %]
# instead of saying this: [% c.prototype.link_to_remote("foo", { url => c.uri_for("blah") } ) %]
Install
Binary package:
pkg_add p5-Catalyst-View-TT-FunctionGenerator
From the ports tree:
cd /usr/ports/textproc/p5-Catalyst-View-TT-FunctionGenerator && make install
Dependencies
No port depends on this one.