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

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

WBOY
Release: 2016-06-06 20:22:14
Original
1557 people have browsed it

如题。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>
Copy after login
  1. 开启facades功能(不推荐)。打开app.php然后:

<code>Dotenv::load(__DIR__.'/../');
$app->withFacades();
$app->withEloquent();</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template