NAME

Mojolicious::Component - Component-based Template Class

ABSTRACT

Component-based Template Abstract Base Class

SYNOPSIS

use Mojolicious::Component;

my $component = Mojolicious::Component->new;

# $component->render

DESCRIPTION

This package provides an abstract base class for rendering derived component-based template (partials) classes.

ATTRIBUTES

This package has the following attributes:

controller

controller(InstanceOf["Mojolicious::Controller"])

This attribute is read-only, accepts (InstanceOf["Mojolicious::Controller"]) values, and is optional.

space

space(InstanceOf["Data::Object::Space"])

This attribute is read-only, accepts (InstanceOf["Data::Object::Space"]) values, and is optional.

template

template(InstanceOf["Mojo::Template"])

This attribute is read-only, accepts (InstanceOf["Mojo::Template"]) values, and is optional.

METHODS

This package implements the following methods:

render

render(Any %args) : Str

The render method loads the component template string data from the DATA section of the component class and renders it using the Mojo::Template object available via "template".

render example #1
# given: synopsis

my $rendered = $component->render;

AUTHOR

Al Newkirk, awncorp@cpan.org

LICENSE

Copyright (C) 2011-2019, Al Newkirk, et al.

This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".

PROJECT

Wiki

Project

Initiatives

Milestones

Contributing

Issues