jacksunny/viewfinder
Composer 安装命令:
composer require jacksunny/viewfinder
包简介
extended plugin on view file finder from view name for laravel framework
README 文档
README
extended plugin on view file finder from view name for laravel framework
How to install and configurate package
- install the laravel package composer require "jacksunny/viewfinder":"dev-master"
please check exist line "minimum-stability": "dev" in composer.json if failed
- append new service provider file line in the section providers of file app.config after appended,it should looks like
'providers' => [
Illuminate\Auth\AuthServiceProvider::class,
......
Jacksunny\ViewFinder\ExtendedViewServiceProvider::class, //only default view finder class
App\Providers\MyExtendedViewServiceProvider::class, //custom my view finder class
],
- add test code to check if it works
Route::get("/{entity}/{type}",function($entity,$type){
return view("$entity.$type");
});
- if wanna custom your ViewFinder you may create a class extends from AbsExtendedFileViewFinder,and a custom service provider extends from ExtendedViewServiceProvider
class MyExtendedFileViewFinder extends AbsExtendedFileViewFinder { public function findNeededFilesInPath($name, $path, $user) { ... } class MyExtendedViewServiceProvider extends ExtendedViewServiceProvider { public function registerViewFinder() { $this->app->bind('view.finder', function ($app) { return new MyExtendedFileViewFinder($app['files'], $app['config']['view.paths']); }); } - please notify me if you got any problem or error on it,thank you!
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2017-06-09