Service_Provider::register()

Binds and sets up implementations.


Source

File: src/Tribe/Views/V2/Service_Provider.php

	public function register() {
		require_once tribe( 'tec.main' )->plugin_path . 'src/functions/views/provider.php';

		if ( ! tribe_events_views_v2_is_enabled() ) {
			return;
		}

		$this->container->singleton( Template_Bootstrap::class, Template_Bootstrap::class );
		$this->container->singleton( Template\Event::class, Template\Event::class );
		$this->container->singleton( Template\Page::class, Template\Page::class );
		$this->container->singleton( Kitchen_Sink::class, Kitchen_Sink::class );
		$this->container->singleton( Theme_Compatibility::class, Theme_Compatibility::class );
		$this->container->singleton( Rest_Endpoint::class, Rest_Endpoint::class );

		$this->register_hooks();
		$this->register_assets();

		$this->register_v1_compat();

		// Register the SP on the container
		$this->container->singleton( 'events.views.v2.provider', $this );

		// Since the View main class will act as a DI container itself let's provide it with the global container.
		View::set_container( $this->container );
	}