pingpong-labs / themes

Laravel 5 Themes
https://pingpong-labs.github.io/docs/themes.html
BSD 3-Clause "New" or "Revised" License
24 stars 15 forks source link

Compatibility with "Laravel 5 Modules" #9

Open blackakula opened 9 years ago

blackakula commented 9 years ago

Modules generated by https://github.com/pingpong-labs/modules has:

General question: why templates are not fallback to theme-outside files? It would be comfortable to have basic templates (for each module), but with ability to be rewritten in scope of theme. Is themes extending/fallback planned to be implemented?

tylers-username commented 8 years ago

I'm interested in this as well. I'll pitch into development where I can but this is outside of my scope of expertise.

Edit: I am trying the following in my module:

 class RecipePrinterController extends Controller
 {
     protected function index()
     {
         Theme::set('default');
         return view('recipeprinter::index');
     }
 ...
 }

And in my view I am using:

 <?php
$defaultTheme=Theme::getCurrent();
$masterLayout="layouts.master";
$masterLayoutStr=$defaultTheme.'::'.$masterLayout;
 ?>
 @extends($masterLayoutStr)

Moving forward I should be able to move the defaultTheme, masterLayout, and masterLayoutStr variables outside of the blade template, set them globally which should give me the freedom templates that fall back to the default when they do not exist.