Get current theme url
UnderlineWords opened this issue · comments
Fatih Kececi commented
Hi, how can i get current theme url for using assets?
Thanks
Thinmy Patrick Alves commented
I think you can use Theme::setProperty programmaticaly or set a path to theme manifest.
http://codex.caffeinated.ninja/themes/master/themes/manifest-file#get-manifest-properties
Kai commented
Hmm, why not use a relative path like:
<link rel="stylesheet" type="text/css" href="/themes/bootstrap/assets/css/bootstrap.min.css">
Or am I missing something here?
Kai commented
I've added both an asset()
and secureAsset()
method to remedy this in v1.2. Usage is simple:
{!! Theme::asset('themeslug::css/bootstrap.css') !!}
{!! Theme::asset('themeslug::js/bootstrap.js') !!}
Be sure to update your theme config file as things have been cleaned up with a few new options added.