-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work around for #22, Doesn't appear to work with repeating fields
- Loading branch information
1 parent
2665e35
commit 977f4e4
Showing
5 changed files
with
92 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace Statamic\Addons\VideoEmbed; | ||
|
||
use Statamic\Extend\ServiceProvider; | ||
use Statamic\Extend\Meta; | ||
|
||
class VideoEmbedServiceProvider extends ServiceProvider | ||
{ | ||
|
||
/** | ||
* Bootstrap the application services. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() { | ||
// | ||
} | ||
|
||
/** | ||
* Register the application services. | ||
* | ||
* @return void | ||
*/ | ||
public function register() { | ||
$this->app->bind('VideoEmbed.resolve-resource-path', function () { | ||
/** | ||
* @param string $path The filename relative to the `resources/assets` directory. | ||
* eg. `js/foo.js` | ||
* @param Addon $addon An instance of Statamic\Extend\Addon for your addon. | ||
* @return string The filename relative to `resources/assets` | ||
* eg. `js/foo.js?id=1234` or `js/foo.somehash.js` | ||
*/ | ||
return function ($path, $addon) { | ||
$meta = new Meta($addon); | ||
$version = ''; | ||
|
||
if ($meta->exists()) { | ||
$meta->load(); | ||
$version = $meta->get('version'); | ||
} | ||
|
||
return $path . '?v=' . $version; | ||
}; | ||
}); | ||
} | ||
} |
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