Mojolicious::Plugin::LiquidToMojo - Liquid to mojo plugin
# 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]
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.
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
Mojolicious::Plugin::LiquidToMojo inherits all methods from Mojolicious::Plugin and implements the following new ones.
$plugin = $plugin->build;
Build Mojolicious template from tree.
$plugin = $plugin->parse($liquid_template);
Parse liquid template into tree.
$plugin->register(Mojolicious->new);
Register plugin in Mojolicious application.
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
darutoko <[email protected]>