NAME
Plack::App::Register - Plack register application.
SYNOPSIS
use Plack::App::Register;
my $obj = Plack::App::Register->new(%parameters);
my $psgi_ar = $obj->call($env);
my $app = $obj->to_app;
METHODS
new
my $obj = Plack::App::Register->new(%parameters);
Constructor.
Returns instance of object.
authorAuthor string to HTML head.
Default value is undef.
content_typeContent type for output.
Default value is 'text/html; charset=__ENCODING__'.
cssInstance of CSS::Struct::Output object.
Default value is CSS::Struct::Output::Raw instance.
css_initReference to array with CSS::Struct structure.
Default value is CSS initialization from Tags::HTML::Page::Begin like
* { box-sizing: border-box; margin: 0; padding: 0; }encodingSet encoding for output.
Default value is 'utf-8'.
faviconLink to favicon.
Default value is undef.
flag_beginFlag that means begin of html writing via Tags::HTML::Page::Begin.
Default value is 1.
flag_endFlag that means end of html writing via Tags::HTML::Page::End.
Default value is 1.
generatorHTML generator string.
Default value is 'Plack::App::Register; Version: __VERSION__'.
login_linkLogin link.
Default value is 'login'.
login_titleLogin title.
Default value is 'LOGIN'.
message_cbCallback to process message from application. Arguments for callback are:
$env,$message_typeand$message. Returns undef.Default value is undef.
psgi_appPSGI application to run instead of normal process. Intent of this is change application in
_process_actionsmethod.Default value is undef.
redirect_registerRedirect URL after successful registering.
Default value is undef.
redirect_errorRedirect URL after error in registering.
Default value is undef.
register_cbCallback for main registering. Arguments for callback are:
$env,usernameand$password. Returns 0/1 for (un)successful registration.Default value is undef.
script_jsReference to array with Javascript code strings.
Default value is [].
script_js_srcReference to array with Javascript URLs.
Default value is [].
status_codeHTTP status code.
Default value is 200.
tagsInstance of Tags::Output object.
Default value is
Tags::Output::Raw->new( 'xml' => 1, 'no_simple' => ['script', 'textarea'], 'preserved' => ['pre', 'style'], );titlePage title.
Default value is 'Register page'.
call
my $psgi_ar = $obj->call($env);
Implementation of login page.
Returns reference to array (PSGI structure).
to_app
my $app = $obj->to_app;
Creates Plack application.
Returns Plack::Component object.
EXAMPLE
use strict;
use warnings;
use CSS::Struct::Output::Indent;
use Plack::App::Register;
use Plack::Runner;
use Tags::Output::Indent;
# Run application.
my $app = Plack::App::Register->new(
'css' => CSS::Struct::Output::Register->new,
'tags' => Tags::Output::Register->new(
'preserved' => ['style'],
'xml' => 1,
),
)->to_app;
Plack::Runner->new->run($app);
# Output:
# HTTP::Server::PSGI: Accepting connections at http://0:5000/
# > curl http://localhost:5000/
# TODO
DEPENDENCIES
Plack::Component::Tags::HTML, Plack::Request, Plack::Response, Plack::Session, Plack::Util::Accessor, Tags::HTML::Container, Tags::HTML::Login::Register.
SEE ALSO
- Plack::App::Login
-
Plack login application.
- Plack::App::Login::Password
-
Plack login/password application.
REPOSITORY
https://github.com/michal-josef-spacek/Plack-App-Register
AUTHOR
Michal Josef Špaček mailto:skim@cpan.org
LICENSE AND COPYRIGHT
© 2023 Michal Josef Špaček
BSD 2-Clause License
VERSION
0.01