在 L3 中,我设法制作了一个模块系统,我可以在其中从管理区域安装/卸载模块。
if(!Bundle::exists($name))
{
// Load the bundle
// If a routes file exists then we'll assume it handles routes of it's own name.
// Remember, if you need it to handle a custom route you should manually add
// the bundle in application/bundles.php.
Bundle::register($name, array(
'handles' => File::exists($path.DS.'routes.php') ? $name : null,
'location' => 'path: '.$path,
'auto' => true)
);
// autobundle is already in the loop that's starting bundles so we
// can't let the normal mechanism start it. We'll start it here.
Bundle::start($name);
}
我如何在 L4 中做到这一点?L4 对我来说看起来很不一样,我在 2 个月前开始使用 L3(第一个框架)