NAME
Minima::View - Base class for views used with Minima
DESCRIPTION
This class serves as a base for views used with Minima. It is not intended to be used directly but rather to be subclassed.
It currently implements two methods: render
and prepare_response
, which should not be called on this base class. (Perhaps, with roles in Perl core in the future, this class might become unnecessary.)
Subclasses
These views are built into Minima by default:
- Minima::View::HTML
-
For rendering HTML content, includes utility methods.
- Minima::View::JSON
-
For creating JSON responses.
- Minima::View::PlainText
-
For plain text output.
For HTML views, see Minima::View::HTML. For JSON, see Minima::View::JSON.
METHODS
new
Constructs a new object. No arguments required.
prepare_response
method prepare_response ($response)
Prepares the provided Plack::Response object for finalizing. Subclasses may use this method to set the Content-Type header, for example.
render
Renders content, and should not be called on this base class.
SEE ALSO
Minima, Minima::View::HTML, perlclass.
AUTHOR
Cesar Tessarin, <cesar@tessarin.com.br>.
Written in September 2024.