default backend/api route
This commit is contained in:
parent
08cdb94dae
commit
cbe1cc1dd2
@ -61,7 +61,7 @@
|
||||
"src" => WROOT . "/media/system/crispedit/editor.js"
|
||||
];
|
||||
|
||||
$route = $this->getRoute("backend");
|
||||
$route = $this->getRoute("backend", "dashboard");
|
||||
if (!$route) throw new NotFoundException();
|
||||
|
||||
$this->setRouteLayout($route);
|
||||
|
@ -17,11 +17,11 @@
|
||||
use \Crispage\Request\Route;
|
||||
|
||||
abstract class SubRouterAction extends \Crispage\Framework\Action {
|
||||
public function getRoute(string $scope): ?Route {
|
||||
public function getRoute(string $scope, string $default = "default"): ?Route {
|
||||
return $this->app->router->getRoute(
|
||||
strval(
|
||||
$this->data["route"] ??
|
||||
$this->app->request->params["route"] ?? "default"
|
||||
$this->app->request->params["route"] ?? $default
|
||||
),
|
||||
$scope
|
||||
);
|
||||
|
@ -39,6 +39,7 @@
|
||||
new Route("/reset_password", "\\Crispage\\Actions\\PasswordResetAction", []),
|
||||
new Route("/user_settings", "\\Crispage\\Actions\\UserSettingsAction", []),
|
||||
new Route("/backend", "\\Crispage\\Actions\\BackendSubRouter", static::RDATA_BACKEND),
|
||||
new Route("/api", "\\Crispage\\Actions\\APISubRouter", static::RDATA_API)
|
||||
],
|
||||
"backend" => [
|
||||
new Route("dashboard", "\\Crispage\\Actions\\Backend\\DashboardAction", static::RDATA_BACKEND),
|
||||
|
Loading…
Reference in New Issue
Block a user