Expand description
URLs into the request’s panel, so app code never spells a prefix.
Each helper answers for the panel serving the request: the one whose
prefix the request is under, or the one it entered with
PanelHandle::enter.
A resource or page that panel does not register has no URL there, and the
helper returns None. auth answers for the pages auth serves: sign-in, profile,
two-factor and the rest of AuthPage.
Every helper but file also answers in a
PanelHandle::context, so a job or a test spells no path: a
page, a resource, an auth page or a record. A handle Panel::handle
gives, which no router mounts, knows only its records’ URLs.
Each helper answers a path. An absolute URL, for a mail or a payment provider’s return,
joins it to the router’s BaseUrl, which a handle’s context
carries too: topcoat::context::try_base_url(cx)?.join(&path).
let posts = tablo_core::url::resource::<PostResource>(cx); // Some("/admin/posts")
let media = tablo_core::url::page::<MediaLibraryPage>(cx); // Some("/admin/media-library")
let home = tablo_core::url::panel(cx); // Some("/admin")Enums§
Functions§
- action
- The route the action
Aruns onrecordat, e.g./admin/posts/42/-/actions/publish, orNonewhenRdoes not declareAon a record: on its rows, detail or edit page. - auth
- The URL of
pagein the request’s panel, such as/admin/profile;Nonewhen the panel’sAuthdoes not serve it, as the other helpers answer for a resource the panel does not register. - bulk_
action - The route the action
Aruns on a selection at, e.g./admin/posts/-/actions/publish, which takes the selected keys in itsidsfield, orNonewhenRdoes not declareAin its bulk bar. - create
R’s create page, e.g./admin/posts/-/create, orNonewhenRserves none.- delete
- The route that deletes
record, e.g./admin/posts/42/delete, which takesconfirm=1. - edit
record’s edit page, e.g./admin/posts/42/edit, orNonewhenRhas no record form.- file
- The URL to link or show a stored file at:
pathwith a signature that expires, when it names a file under aPanel::uploads_dirof any panel on the router, andpathitself otherwise. - page
P’s URL in the request’s panel:{prefix}/{slug}, or the prefix itself for the panel’shomepage.- panel
- The request’s panel prefix, e.g.
/admin. - record
record’s detail page in the context’s panel, e.g./admin/posts/42, orNonewhenRdeclares no detail.- record_
page record’s record pageP, e.g./admin/orders/42/history, orNonewhenRdoes not declareP. The URL answers 403 to a request the page’s access refuses.- resource
R’s list URL in the request’s panel, e.g./admin/posts.