NAME
Mojolicious::Plugin::Module::Abstract - Abstract class for modules.
OVERVIEW
Abstract class for modules provides methods to init some aspects of modules such as routes, templates, configs, etc. Use it to define your modules.
Methods
init($self, $app, $path)
Initialize module.
init_templates($self, $app)
Add templates paths to mojolicious renderer.
init_config($self, $app, $path)
Looks for ./config/module.conf
config in YAML format an load it. Also trying to load local config for this module from application config/vendor/module_name.yaml
(YAML too). Configs will be merged.
You can get module's config this way:
$app->module->get('module_name')->config->{some_config_key}
Or directly from module object.
- $app
-
Current mojolicious application object.
- $path
-
Path to this module in filesystem. Will be in
config-
{path}>.
init_routes($self, $app)
Override this method in your module and define routes.
init_helpers($self, $app)
Override this method in your module and define helpers.
startup($self, $app)
Override this method in your module if module needs some more initialization code.
SEE ALSO
Mojolicious::Plugin::Module, Mojolicious::Guides, http://mojolicio.us.
COPYRIGHT AND LICENSE
Copyright (C) 2014, Georgy Bazhukov.
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.