Service_Provider
The main service provider for Filterbar support and additions to the Views V2 functions.
Source
File: src/Tribe/Views/V2/Service_Provider.php
class Service_Provider extends \tad_DI52_ServiceProvider {
/**
* Binds and sets up implementations.
*
* @since 4.9.0
*/
public function register() {
if ( ! tribe_events_views_v2_is_enabled() ) {
return;
}
$this->container->singleton( Filters::class, Filters::class );
$this->register_hooks();
$this->register_assets();
// Register the SP on the container
$this->container->singleton( 'filterbar.views.v2.provider', $this );
$this->container->singleton( static::class, $this );
}
/**
* Registers the provider handling all the 1st level filters and actions for Views v2.
*
* @since 4.9.0
*/
protected function register_assets() {
$assets = new Assets( $this->container );
$assets->register();
$this->container->singleton( Assets::class, $assets );
}
/**
* Registers the provider handling all the 1st level filters and actions for Views v2.
*
* @since 4.9.0
*/
protected function register_hooks() {
$hooks = new Hooks( $this->container );
$hooks->register();
// Allow Hooks to be removed, by having the them registred to the container
$this->container->singleton( Hooks::class, $hooks );
$this->container->singleton( 'filterbar.views.v2.hooks', $hooks );
}
}
Changelog
| Version | Description |
|---|---|
| 4.9.0 | Introduced. |
Methods
- register — Binds and sets up implementations.