Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with "Laravel 5 Modules" #9

Open
blackakula opened this issue Sep 9, 2015 · 1 comment
Open

Compatibility with "Laravel 5 Modules" #9

blackakula opened this issue Sep 9, 2015 · 1 comment

Comments

@blackakula
Copy link

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

  • view() function instead of \Theme::view()
  • templates namespacing fails (example: \Theme::view('mymodule::index')) because it looks for template mytheme::mymodule instead of index template inside mymodule::mytheme

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants