Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/memowe/mojolicious-plugin-relativeurlfor

relative links in Mojolicious, really.
https://github.com/memowe/mojolicious-plugin-relativeurlfor

Last synced: 14 days ago
JSON representation

relative links in Mojolicious, really.

Awesome Lists containing this project

README

        

Mojolicious::Plugin::RelativeUrlFor - relative links in Mojolicious, really.

This plugin adds two useful helpers to Mojolicious, that help you using URLs
relative to the request URL: relative_url_for and rel_url_for. It's also
possible to replace the url_for helper which influences link_to and form_for.

Installation:

perl Makefile.PL
make
make test
make install

Basic usage:

# Mojolicious
$self->plugin('RelativeUrlFor');

# Mojolicious::Lite
plugin 'RelativeUrlFor';

# In your actions:
$rel_url = $self->rel_url_for('foo', bar => 'baz');

# In your templates:
<%= rel_url_for 'foo', bar => 'baz' %>

For more informations, see the inlined POD documentation in
lib/Mojolicious/Plugin/RelativeUrlFor.pm or view it in the terminal with

perldoc Mojolicious::Plugin::RelativeUrlFor

Copyright Mirko Westermeier

This software is released under the MIT license. See MIT-LICENSE for details.