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

How to use partials in a module #869

Open
afarral opened this issue Nov 5, 2019 · 1 comment

Comments

@afarral
Copy link

@afarral afarral commented Nov 5, 2019

I have a master layout file in the main app, it contains some @include() statements,
i.e. @include('layouts.main-sidebar') within this i include a partial which contains the actual menu:@include('partials.menu') - may aim is that for each module the partial from that 'module' is used, is this possible?
Here an over view of my file structure to try to help explain:

app / Resources / views/ layouts / main-layout.blade.php
app / Resources / views/ layouts / partials main.blade.php

main-layout.blade contains @include('partials.menu')

moduleA / Resources / views/ index.blade (this extends main-layout.blade.php )
moduleA / Resources / views/ partials / menu.blade.php

I need the menu.blade.php to be used when viewing moduleA / Resources / views/ index.blade

@nWidart

This comment has been minimized.

Copy link
Owner

@nWidart nWidart commented Nov 7, 2019

Hello,

These are namespaced by module, explained here: https://laravel.com/docs/6.x/packages#views

Meaning you can call the views by prefixing the module name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.