-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
30 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
<?php | ||
|
||
if (!function_exists('get_dist_path')) { | ||
function get_dist_path($path) | ||
{ | ||
return trailingslashit(\App\config('theme.dir')) . trailingslashit('dist') . $path; | ||
} | ||
namespace BladeSvgSage; | ||
|
||
use function App\sage; | ||
use function App\config; | ||
|
||
/** | ||
* Get Sage's dist path | ||
* | ||
* @param string $path | ||
* @return string | ||
*/ | ||
function get_dist_path($path) | ||
{ | ||
return trailingslashit(config('theme.dir')) . trailingslashit('dist') . $path; | ||
} | ||
|
||
if (!function_exists('svg_image')) { | ||
function svg_image($icon, $class = '', $attrs = []) | ||
{ | ||
return wp_die('test'); | ||
return \App\sage(\BladeSvg\SvgFactory::class)->svg(\App\sage('assets')->get($icon), $class, $attrs); | ||
} | ||
/** | ||
* Simple helper for our directive. | ||
* | ||
* @param string $icon | ||
* @param string $class | ||
* @param array $attrs | ||
* @return mixed | ||
*/ | ||
function svg_image($icon, $class = '', $attrs = []) | ||
{ | ||
return sage(\BladeSvg\SvgFactory::class)->svg(sage('assets')->get($icon), $class, $attrs); | ||
} |