caffeinated / themes

:art: Laravel Themes package with support for the Caffeinated Modules package.

Home Page:https://caffeinatedpackages.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get current theme url

UnderlineWords opened this issue · comments

Hi, how can i get current theme url for using assets?
Thanks

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

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?

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.