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
精彩评论