- Admin guide: RBAC roles, role-based dashboard, plugin types (content/system) - CodePress developer guide: plugin types, admin plugin API, SCSS compilation, asset serving - Theme developer guide: SCSS sole CSS source, css_compiled read-only, guide layout - Content manager guide: layout selection from theme.json, plugin order in frontmatter - Both NL and EN updated with identical structure - 35 files updated
1.9 KiB
1.9 KiB
Routing
Frontend routing
Frontend routing goes through cms/router.php (PHP dev server) or .htaccess (Apache). Both provide clean URLs.
PHP dev server
Start the server with:
php -S localhost:8080 cms/router.php
cms/router.php serves:
- Clean URLs:
/nl/page→public/index.php?page=page&lang=nl themes/assetsadmin/assets/assetsplugins/assets
Apache (live server)
public/.htaccess rewrites URLs to public/index.php. Asset URLs (/themes/, /admin/assets/, /plugins/) are forwarded to public/asset.php.
public/asset.php serves files from the correct folders with the correct MIME type:
/themes/<name>/assets/...→themes/<name>/assets/.../admin/assets/...→admin/theme/default/assets/.../plugins/<name>/assets/...→plugins/<name>/assets/...
Admin routing
Admin routing goes through public/admin.php with clean URLs:
/admin/dashboard → ?route=dashboard
/admin/content → ?route=content
/admin/plugins → ?route=plugins
cms/router.php or .htaccess converts /admin/<route> to ?route=<route>.
Route access control (RBAC)
Each route is checked via AdminAuth::hasPermission($route):
- The
adminrole has wildcard*access - Other roles have an explicit list of allowed routes in
ROLE_PERMISSIONS - Unauthorized routes return a 403 error
Plugin admin routing
System plugins can register admin routes. These are handled by PluginManager::handleAdminRoute($route):
- The system plugin registers routes via
getAdminRoutes() PluginManager::getAdminMenuItems()collects admin menu items viagetAdminMenu()- On an admin request
PluginManager::handleAdminRoute($route)finds a plugin that handles the route - The plugin method
handleAdminRoute($route)renders the page content
// PluginManager calls this for /admin/my-system
$plugin->handleAdminRoute('my-system');