I’m trying to build a context menu in the frontend, with a link to edit the current page in the panel. How can I get the URL to the panel edit form for a given Page object? I’m looking for something like $page->editUrl() or $page->panelUrl(), but can’t find anything. I’ve also checked the Panel class, but it doesn’t have a method for that either.
Also, how do you get panel URLs in general? For example, I want to show links to:
@texnixe Thank you! I’ve figured out most of the other routes as well, I’ll leave that here in case anyone else is looking for this:
use Kirby\Panel\Panel;
$urls = [
// panel
$kirby->url('panel'),
// site dashboard
$site->panel()->url(),
// page edit form
$page->panel()->url(),
// user profile
$kirby->user()->panel()->url(),
// users list
Panel::url('users'),
// logout
Panel::url('logout'),
];
Not sure about the last two, though. Is the Panel::url() method the only way to get those URLs relative to the panel’s slug? Is there a cleaner way to access those routes and get their URL?