Skip to content

Latest commit

 

History

History
71 lines (43 loc) · 1.63 KB

README.pod

File metadata and controls

71 lines (43 loc) · 1.63 KB

NAME

Mojolicious::Plugin::LiquidToMojo - Liquid to mojo plugin

SYNOPSIS

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

# Mojolicious::Lite
plugin 'LiquidToMojo';

# Convert Liquid template
my $ep_template = app->liquid_to_mojo($liquid_template);

# All "objects" should be hashref, arrayref, or simple scalar
foo            # => $foo
foo.bar        # => $foo->{bar}
foo[0]         # => $foo->[0]
foo.bar.baz    # => $foo->{bar}{baz}
foo.bar.baz[0] # => $foo->{bar}{baz}[0]

DESCRIPTION

Mojolicious::Plugin::LiquidToMojo is a Mojolicious plugin for convertion Liquid templates in to Mojolicious or Embedded Perl (.ep) templates.

Note that map and escape_once filters, raw and comment tags are not implemented.

HELPERS

Mojolicious::Plugin::LiquidToMojo registers the following helpers to mock behavior of filters.

date_liquid_filter, contains_liquid_filter, plus_liquid_filter, size_liquid_filter escape_liquid_filter, capitalize_liquid_filter, strip_html_liquid_filter

METHODS

Mojolicious::Plugin::LiquidToMojo inherits all methods from Mojolicious::Plugin and implements the following new ones.

build

$plugin = $plugin->build;

Build Mojolicious template from tree.

parse

$plugin = $plugin->parse($liquid_template);

Parse liquid template into tree.

register

$plugin->register(Mojolicious->new);

Register plugin in Mojolicious application.

SEE ALSO

Mojolicious, Mojolicious::Guides, http://mojolicio.us.

AUTHOR

darutoko <[email protected]>