简体   繁体   中英

Extending parent template with same name in laravel blade

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. 😉

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM