Skip to content

Commit

Permalink
Added helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
karlomikus committed Oct 27, 2015
1 parent 907ffb8 commit 681169b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
"autoload": {
"psr-4": {
"Karlomikus\\Theme\\": "src/Theme"
}
},
"classmap": [
"src/Theme/helpers.php"
]
},
"autoload-dev": {
"classmap": [
Expand Down
17 changes: 17 additions & 0 deletions src/Theme/helpers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

if (!function_exists('theme_asset')) {
/**
* Generate an theme asset path for the application.
*
* @param string $path
* @param bool $secure
* @return string
*/
function theme_asset($path, $secure = null)
{
$currentThemePath = app('theme')->get()->getPath();

return app('url')->asset($currentThemePath . $path, $secure);
}
}

0 comments on commit 681169b

Please sign in to comment.