Is that possible to use laravel blade outside the view folder?

前端 未结 3 824
面向向阳花
面向向阳花 2021-02-06 13:42

I got a wordpress blog inside the public sub folder.

I wanted to use same layout with the laravel view that using blade.

Is there anyway to achieve that?

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-06 14:01

    You can define a custom namespace for easier usage:

    // Register your custom namespace in your AppServiceProvider in the boot() method
    view()->addNamespace('custom_views', app_path('custom_path'));
    
    // usage:
    view('custom_views::some.view.name')
    

提交回复
热议问题