Marquee Marquee::Plugin::EPHelperExample - An Example for EP helpers

TABLE OF CONTENTS

NAME

Marquee::Plugin::EPHelperExample - An Example for EP helpers

SYNOPSIS

$app->plugin('EPHelperExample');

In templates..

<%= commify($price) %>
<%= min(@prices) %>
<%= max(@prices) %>
<%= replace($string, '::', '/') %>
<%= replace($string, qr/\s/, '') %>

DESCRIPTION

This is an example plugin for adding EP template functions.

FUNCTIONS

The following template functions are available.

commify

Commifies given number.

<%= commify(123456789) %> <!-- 123,456,789 -->

min

Finds the minimum value of array of numbers.

<%= min(1, 2, 3) %> <!-- 1 -->

max

Finds the maximum value of array of numbers.

<%= max(1, 2, 3) %> <!-- 3 -->

replace

Replaces given string or pattern in given string.

<%= replace('foo::bar', '::', '/') %> <!-- foo/bar -->
<%= replace('foo::::bar', qr{:+}, '/') %> <!-- foo/bar -->

INSTANCE METHODS

Marquee::Plugin::EPHelperExample inherits all instance methods from Marquee::Plugin and implements the following new ones.

register

Register the plugin.

$self->register($app);

SEE ALSO

Marquee::SSIHandler::EP, Marquee, Mojolicious