I've followed the example provided in plugin to add /my_custom_page route. For example, we want to add a menu page or whatever page, under Azuracast (to be accessible by admin, at https://example.com/station/1/my_custom_page and https://example.com/admin/my_custom_page
However, after restarting container azuracast_web , when i visit mysite.com/my_custom_page, I get:
404 Not Found
The requested resource could not be found. Please verify the URI and try again.
Go Back
here the code in example-plugin:
$dispatcher->addListener(Event\BuildView::class, function(Event\BuildView $event) {
$event->getView()->addFolder('my_custom_page', __DIR__.'/templates');
});
$dispatcher->addListener(Event\BuildRoutes::class, function(Event\BuildRoutes $event) {
$app = $event->getApp();
$app->get('/my_custom_page', \Plugin\ExamplePlugin\Controller\HelloWorld::class)->setName('example-plugin:sample:index')
->add(\App\Middleware\EnableView::class);
});
$dispatcher->addListener(App\Event\BuildAdminMenu::class, function (App\Event\BuildAdminMenu $e) {
$router = $e->getRouter();
$e->merge([
'myCustomParentMenu' => [
'label' => __('My example Menu'),
'icon' => 'router',
'items' => [
'settings2' => [
'label' => __('My example Menu Label'),
'url' => $router->named('example-plugin:sample:index'),
'permission' => Acl::GLOBAL_SETTINGS,
]
],
]
]);
});
I've followed the example provided in plugin to add
/my_custom_pageroute. For example, we want to add a menu page or whatever page, under Azuracast (to be accessible by admin, athttps://example.com/station/1/my_custom_pageandhttps://example.com/admin/my_custom_pageHowever, after restarting container
azuracast_web, when i visitmysite.com/my_custom_page, I get:here the code in example-plugin: