在laravel刀片中扩展具有相同名称的父模板

I'm developing a plugin system for a new project of me. And search for a solution to extending blade templates in laravel with the same name.

To understand. I've a template foo.blade.php in the default laravel dir resources/views/ and the same template foo.blade.php in plugins/Foobar/Views. And in the plugin template I make a @extend('foo') to extend the parent main template foo.blade.php. The template can find in more than one plugins use, so I have at the end of the day at example the following directory sort to find my templates:

  • plugins/Bazbar/Views
  • plugins/Foobar/Views
  • plugins/Helloworld/Views
  • resources/views

Understand what the idea is? Any solutions or ideas how can I build that?

Thanks a lot and regards

Stefan


I use now Twig. And have build a simple token parser. This is for me a good solution and I can extend recursively templates in my application with plugins.