Home >Backend Development >PHP Tutorial >lumen怎样实现Laravel中的Route::Controller?

lumen怎样实现Laravel中的Route::Controller?

WBOY
WBOYOriginal
2016-06-06 20:22:141551browse

如题。lumen怎样实现Laravel中的Route::Controller。
例如:Route::Controller('admin','Admin\AdminController');

回复内容:

如题。lumen怎样实现Laravel中的Route::Controller。
例如:Route::Controller('admin','Admin\AdminController');

在lumen里面是不同的设置。

  1. 你可以在routes.php里面设置:

<code>$app->get('admin', 'AdminController@index');</code>
  1. 开启facades功能(不推荐)。打开app.php然后:

<code>Dotenv::load(__DIR__.'/../');
$app->withFacades();
$app->withEloquent();</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn