Total Complexity | 3 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class Plugin extends BasePlugin |
||
15 | { |
||
16 | /** |
||
17 | * Load all the plugin configuration and bootstrap logic. |
||
18 | * |
||
19 | * The host application is provided as an argument. This allows you to load |
||
20 | * additional plugin dependencies, or attach events. |
||
21 | * |
||
22 | * @param \Cake\Core\PluginApplicationInterface $app The host application |
||
23 | * @return void |
||
24 | */ |
||
25 | public function bootstrap(PluginApplicationInterface $app): void |
||
26 | { |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Add routes for the plugin. |
||
31 | * |
||
32 | * If your plugin has many routes and you would like to isolate them into a separate file, |
||
33 | * you can create `$plugin/config/routes.php` and delete this method. |
||
34 | * |
||
35 | * @param \Cake\Routing\RouteBuilder $routes The route builder to update. |
||
36 | * @return void |
||
37 | */ |
||
38 | public function routes(RouteBuilder $routes): void |
||
39 | { |
||
40 | $routes->plugin( |
||
41 | 'Sluggable', |
||
42 | ['path' => '/sluggable'], |
||
43 | function (RouteBuilder $builder) { |
||
44 | // Add custom routes here |
||
45 | |||
46 | $builder->fallbacks(); |
||
47 | } |
||
48 | ); |
||
49 | parent::routes($routes); |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * Add middleware for the plugin. |
||
54 | * |
||
55 | * @param \Cake\Http\MiddlewareQueue $middlewareQueue The middleware queue to update. |
||
56 | * @return \Cake\Http\MiddlewareQueue |
||
57 | */ |
||
58 | public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue |
||
63 | } |
||
64 | } |
||
65 |