你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
Mr_Jing
赞同来自: zhuzhichao
FiveSay - 成武
赞同来自: Adger
rocet
赞同来自:
app ---modules ---ServiceProvider.php ---Admin ---AdminServiceProvider.php ---routes.php ---config ---controllers ---AdminController.php ---views ---...... ---...... --------------------------------------------------------------------------------------------- app\modules\ServiceProvider.php <?php namespace App\Modules; abstract class ServiceProvider extends \Illuminate\Support\ServiceProvider { public function boot() { if ($module = $this->getModule(func_get_args())) { $this->package('app/' . $module, $module, app_path() . '/modules/' . $module); } } public function register() { if ($module = $this->getModule(func_get_args())) { $this->app['config']->package('app/' . $module, app_path() . '/modules/' . $module . '/config'); foreach (\Config::get('app.aliases') as $alias => $source) { class_alias($source, 'App\Modules\\' . $module . '\Controllers\\' . $alias); } $routes = app_path() . '/modules/' . $module . '/routes.php'; if (file_exists($routes)) require $routes; } } public function getModule($args) { $module = (isset($args[0]) and is_string($args[0])) ? $args[0] : null; return $module; } } --------------------------------------------------------------------------------------------- app\modules\Admin\AdminServiceProvider.php <?php namespace App\Modules\Admin; class AdminServiceProvider extends \App\Modules\ServiceProvider { public function register() { parent::register('Admin'); } public function boot() { parent::boot('Admin'); } } --------------------------------------------------------------------------------------------- app\modules\Admin\controllers\AdminController.php <?php namespace App\Modules\Admin\Controllers; class AdminController extends \BaseController { ..... } --------------------------------------------------------------------------------------------- app\config\app.php 'providers' => array( ..... 'App\Modules\Admin\AdminServiceProvider', ), --------------------------------------------------------------------------------------------- composer.json "autoload": { "classmap": [ ..... "app/modules", ] } --------------------------------------------------------------------------------------------- composer dump-autoload --optimize
要回复问题请先登录或注册
3 个回复
Mr_Jing
赞同来自: zhuzhichao
FiveSay - 成武
赞同来自: Adger
rocet
赞同来自: