NAME
Minima::View::PlainText - Render plain text views
SYNOPSIS
use Minima::View::JSON;
my $view = Minima::View::PlainText->new;
$view->prepare_response($response);
my $body = $view->render("hello, world\n");
DESCRIPTION
Minima::View::PlainText provides a utility view for generating plain text responses, following the same conventions as other native Minima views.
Note: Minima::View::PlainText encodes strings as UTF-8.
METHODS
new
method new ()
Creates a new instance of the class. This method does not require any arguments.
prepare_response
method prepare_response ($response)
Sets the appropriate Content-Type header on the provided Plack::Response object.
render
method render ($data = '')
Encodes the provided string as UTF-8 and returns it.
SEE ALSO
Minima, Minima::Controller, Minima::View, perlclass.
AUTHOR
Cesar Tessarin, <cesar@tessarin.com.br>.
Written in November 2024.