I am using this code inside my PHP file:
layout.blade.php
{{ HTML::script('js/abc.js'); }}
The problem is abc will be different for different pages, so I need to change it to a variable (i.e. $js) to make the value dynamic.
Currently I am using:
{{ HTML::script('js/'.$js.'.min.js') }} to achieve this.
I was wondering whether this is the regular way to do this? Or is there any better way?
And I tried to use {{ HTML::script('js/'.$js.'.min.js') or ''}} to check the existence of $js, but it's not working. Is @if (isset($js)) my only solution?
Thanks.
$jsset? do you scan directories for this? or just simple string assignment?withmethod inroutes.phpi.e.->with('js', 'index')