-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathguide-routing.php
More file actions
23 lines (18 loc) · 977 Bytes
/
guide-routing.php
File metadata and controls
23 lines (18 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use Symfony\Component\Routing\Loader\XmlFileLoader;
use Webfactory\ShortcodeBundle\Controller\GuideController;
return static function (RoutingConfigurator $routes): void {
foreach (debug_backtrace() as $trace) {
if (isset($trace['object']) && $trace['object'] instanceof XmlFileLoader && 'doImport' === $trace['function']) {
if (__DIR__ === dirname(realpath($trace['args'][3]))) {
trigger_deprecation('webfactory/shortcode-bundle', '2.7', 'The "guide-routing.xml" routing configuration file is deprecated, import "guide-routing.php" instead.');
break;
}
}
}
$routes->add('webfactory.shortcode.guide-list', '/')
->controller([GuideController::class, 'listAction']);
$routes->add('webfactory.shortcode.guide-detail', '/{shortcode}/')
->controller([GuideController::class, 'detailAction']);
};