开发者

Loading "modules" in Mojolicious

开发者 https://www.devze.com 2023-02-07 14:03 出处:网络
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/ fo

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

精彩评论

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

关注公众号