| 1 |
<?php |
| 2 |
|
| 3 |
namespace Depicter\Editor; |
| 4 |
|
| 5 |
use WPEmerge\ServiceProviders\ServiceProviderInterface; |
| 6 |
|
| 7 |
/** |
| 8 |
* Loads editor. |
| 9 |
*/ |
| 10 |
class EditorServiceProvider implements ServiceProviderInterface { |
| 11 |
|
| 12 |
/** |
| 13 |
* {@inheritDoc} |
| 14 |
*/ |
| 15 |
/** |
| 16 |
* {@inheritDoc} |
| 17 |
*/ |
| 18 |
public function register( $container ) { |
| 19 |
$container[ 'depicter.editor' ] = function () { |
| 20 |
return new Editor(); |
| 21 |
}; |
| 22 |
|
| 23 |
$app = $container[ WPEMERGE_APPLICATION_KEY ]; |
| 24 |
$app->alias( 'editor', 'depicter.editor' ); |
| 25 |
|
| 26 |
$container[ 'depicter.editor.assets' ] = function () { |
| 27 |
return new EditorAssets(); |
| 28 |
}; |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* {@inheritDoc} |
| 33 |
*/ |
| 34 |
public function bootstrap( $container ) { |
| 35 |
\Depicter::app()->editor()->init(); |
| 36 |
} |
| 37 |
|
| 38 |
} |
| 39 |
|