PluginProbe
Depicter — Popup & Slider Builder / 1.6.2
Depicter — Popup & Slider Builder v1.6.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / Routing / RouteConditionsServiceProvider.php

RouteConditionsServiceProvider.php in Depicter — Popup & Slider Builder 1.6.2, at app/src/Routing/RouteConditionsServiceProvider.php

45 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Depicter\Routing;
3
4 use Depicter\Routing\Conditions\EditorOpen;
5 use Depicter\Routing\Conditions\EditorPreview;
6 use WPEmerge\ServiceProviders\ServiceProviderInterface;
7
8 /**
9 * Provide custom route conditions.
10 * This is an example class so feel free to modify or remove it.
11 */
12 class RouteConditionsServiceProvider implements ServiceProviderInterface {
13 /**
14 * {@inheritDoc}
15 */
16 public function register( $container ) {
17 $this->registerRouteCondition( $container, 'depicter.condition.editor.open' , EditorOpen::class );
18 $this->registerRouteCondition( $container, 'depicter.condition.editor.preview', EditorPreview::class );
19 }
20
21 /**
22 * {@inheritDoc}
23 */
24 public function bootstrap( $container ) {
25 // Nothing to bootstrap.
26 }
27
28 /**
29 * Register a class as a route condition
30 *
31 * @param \Pimple\Container $container
32 * @param string $name
33 * @param string $class_name
34 * @return void
35 */
36 protected function registerRouteCondition( $container, $name, $class_name ) {
37 $container[ WPEMERGE_ROUTING_CONDITION_TYPES_KEY ] = array_merge(
38 $container[ WPEMERGE_ROUTING_CONDITION_TYPES_KEY ],
39 [
40 $name => $class_name,
41 ]
42 );
43 }
44 }
45