vanilophp / framework

The truly Laravel E-commerce Framework
https://vanilo.io
MIT License
810 stars 102 forks source link

View override #50

Closed samo9789 closed 5 years ago

samo9789 commented 5 years ago

I’m using vanilo in a project I’m working on even though I realise you do not have the 1.0 yet. I’ve had to modify a few of the views in vendor/vanilo/framework/resources/views and I was wondering if you envisioned a system to override some of the views or controllers in the framework properly ? SO I could have modified views in my main folder and leave everything untouched in vendor. Thanks for your help and for this very promising project for the Laravel community

fulopattila122 commented 5 years ago

Fortunately, Laravel supports this out of the box, see Overriding Package Views.

So basically what you have to do is to copy the necessary view from the vendor folder from your app's resources/views/vendor/ folder and there you can use the overridden version.

samo9789 commented 5 years ago

Thanks for your quick answer, works perfectly. Actually, I also need some adjustments in a controller. Can the same be done for controllers ? I will ask in a separate questions so others can find it later.

samo9789 commented 5 years ago

Hey

Sorry to bother you again but I had a follow up question regarding overriding a controller method.

For example I added some data in orderController :: show that I pass to my modified view.

https://github.com/vanilophp/framework/issues/51

Thank you On 9 Jul 2019 at 17:49 +0200, Attila Fulop notifications@github.com, wrote:

Fortunately, Laravel supports this out of the box, see Overriding Package Views. So basically what you have to do is to copy the necessary view from the vendor folder from your app's resources/views/vendor/ folder and there you can use the overridden version. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.