| 1 |
<?php |
| 2 |
/** |
| 3 |
* The provider for the view system. |
| 4 |
* |
| 5 |
* @package SolidWP\Performance |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
namespace SolidWP\Performance\View; |
| 11 |
|
| 12 |
use SolidWP\Performance\Contracts\Service_Provider; |
| 13 |
use SolidWP\Performance\View\Contracts\View; |
| 14 |
use SolidWP\Performance\View\Renderers\WordPress; |
| 15 |
|
| 16 |
if ( ! defined( 'ABSPATH' ) ) { |
| 17 |
exit; |
| 18 |
} |
| 19 |
|
| 20 |
/** |
| 21 |
* The provider for the view system. |
| 22 |
* |
| 23 |
* @package SolidWP\Performance |
| 24 |
*/ |
| 25 |
final class Provider extends Service_Provider { |
| 26 |
|
| 27 |
/** |
| 28 |
* {@inheritdoc} |
| 29 |
*/ |
| 30 |
public function register(): void { |
| 31 |
$this->container->singleton( |
| 32 |
WordPress::class, |
| 33 |
new WordPress( __DIR__ . '/../../views' ) |
| 34 |
); |
| 35 |
|
| 36 |
$this->container->bind( View::class, $this->container->get( WordPress::class ) ); |
| 37 |
} |
| 38 |
} |
| 39 |
|