I'm currently struggleing with blade layout engine. Please let me explain:
My application based on multiple modules, every module contain it's own template files, but if i want to add a special component from another module, i have to hard code it in the layout file.
For example, i have two modules, a customer module and a subscription module and the subscription module has a special component, which display the subscription of the customer.
// module-customer/views/pages/customer.blade.php
...
<div>
<subscription::user-subscription />
</div>
...
I want to prevent this hardcoding part!
I like the magento solution, which uses multiple XML files to combine this. In the customer module i define a "block" with a name like "customer-profile-details" and in the second module i can inject the "user-subscription" component in the already defined block.
// module-customer/views/pages/customer.xml
...
<block name=""customer-profile-details" class="\Customer\Components\Profile\Details" />
...
// module-subscription/views/pages/customer.xml
...
<reference name="customer-profile-details">
<block name=""customer-subscription" class="\Subscription\Components\User" />
</reference>
...
// module-customer/views/components/profile/details.blade.php
...
<div>
{{ $this->getChildBlock('customer-profile-details') }}
</div>
...
Does anybody know a solution like this or has maybe an alternative idea?
I hope it is understandable :)
thanks a lot