laravel-handlebars
laravel-handlebars copied to clipboard
Support for view composers on partials
Ok so I realise this is a niche feature most people won't use, but I find especially useful when using a template engine like this.
View composers work fine for the main view or layout of a page but when you register for partial included using the {{> _partialname }} syntax it never fires.
I currently use the view composer for my layout controller which trims that down nicely, and lets me set some variables as arrays that I cannot access directly in handlebars normally. I wanted to implement a view composer for a partial called sidebar since I have a lot of custom stats being pulled in for the sidebar, but currently limited to one view composer.