Sloths shipping with a lot of builtin useful helpers
views/my-view-script.html.php
As you know, the assets tag might caching by the browser.
For example, sometime you changes the javascript code,
but you might need press Ctrl+F5
on Windows or Cmd+F5
on Mac to tell browser update your script code.
Is is bad for end user, they don't know you was changes the script code.
Solved that problem is very simple, just append the assert script source url with a increment parameter version number whenever you change the script code.
application/config/view.php
Changes v1
to v2
, v3
,.. whenever you change the script code.
And now you call asset tag helper like above, the output is:
Or if you want to directive config per assert by calling: setDisableCachingParam('v1')
The output now is:
For development mode, I recommend you to set the disable caching param value to time()
The output look like:
views/my-view-script.php