Answer the question
In order to leave comments, you need to log in
How to dynamically include CSS/JS from a controller?
The essence is the controller, in the widget method , in addition to the processed data (list of news / etc), we also return an array with links to the necessary css and js for the current page . How to display them in the head tag, if there is already a block of generated links to css-styles and js-scripts that were returned by a method defined for a specific page?
At the moment I see only one option - css and js for widgets should be displayed after body in the same block as in head .
Answer the question
In order to leave comments, you need to log in
Read about blade templating engine
and @section() @yeild()
constructs@yeild('css')
@section('css')
<link src=>
@stop
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question