-
-
Save nboliver/fd48e5b0703f55a592b8d1ea85111895 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
namespace App; | |
/** | |
* Custom Blade directives | |
*/ | |
add_action('after_setup_theme', function () { | |
/** | |
* Icon Blade directives | |
*/ | |
sage('blade')->compiler()->directive('icon', function ($id) { | |
if($id){ | |
return '<svg class="icon icon--' . $id . '"><use xlink:href="' . asset_path("images/symbols.svg") . '#icon-' . $id . '"></use></svg>'; | |
} | |
}); | |
} | |
This file contains hidden or 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
@icon('facebook') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment