【问题标题】:Loading "modules" in Mojolicious在 Mojolicious 中加载“模块”
【发布时间】:2011-06-16 11:26:15
【问题描述】:

需要帮助。实现“模块”的安装和加载所必需的。 “模块”插件位于 lib// 之类的文件中。我想我应该以某种方式将搜索子目录 lib/ 用于“模块”,加载插件以检查它是否已安装,如果没有安装它(例如,MyApp::MyModule->install())。该插件包含“模块”、助手等。您有什么想法吗?

看起来像最终代码:

# 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;
}

【问题讨论】:

    标签: perl plugins loader mojo mojolicious


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-24
      • 2015-02-09
      • 2017-10-12
      • 1970-01-01
      相关资源
      最近更新 更多