开发者

Loading "modules" in Mojolicious

Need for help. Necessary to implement the installation and loading of "modules". "Module" plug-in is located in the file like lib//. I think I should somehow take the search subdirectories lib/ for "module"开发者_如何学编程, load the plugin to check if it is installed, and install it if not (for example, MyApp::MyModule->install()). The plugin contains "module", helpers, etc. Does you have anything ideas?

seems like final code:

# Load Core
my $_core = $self->plugin('FW::Core');

# Load modules
my $plugins = FW::Core::Model::Module->select->hashes();
if(@$plugins) {
    $self->plugin('FW::' . ucfirst $_->{name}) for @$plugins;
}


Module::Pluggable

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜