igaster / laravel-theme

Theme support for Laravel
MIT License
520 stars 113 forks source link

How do I access the views/assets of a parent theme? #18

Closed extrakun closed 8 years ago

extrakun commented 8 years ago

It will be great if there's a way for us to access the parent theme views/assets; is there anyway to do so?

igaster commented 8 years ago
  1. As for views NO. you have to switch to the parent Theme first. You can always get the parent theme name using Theme::config('extends');
  2. As for the assets YES. You can get the parent Theme instance using:

    $parentTheme = Theme::find(Theme::config('extends'));

and build your views using $parentTheme. eg:

    $parentTheme->url('logo.png');