v0.0.31
27 June 2026
Real before/after router hooks, route tokens switched to {name} syntax, controller chain simplified to app + view only.
Added
Router::before()/after(): hooks registered from any router file in the dispatch chain.beforehooks run once, after every router file has loaded, right before route matching;afterhooks run once a route's handler has resolved a result page, right before it's returned. Both receive($app, $page).Page::route()dispatch order is now explicit: the'app'router runs first (kept, not discarded), then each ancestor page's router (root → immediate parent, routes discarded), then the current page's own router (routes kept).
Changed
- Route tokens switched from
(:name)to{name}syntax, echoing Latte's own tag delimiters :{any}now matches one non-empty segment (previously zero-or-more),{all}still matches across slashes including empty. Page/Addoncontroller chain simplified to exactly two layers : global controller (views/controller.php) then the page's own view controller : replacing the old three-layer base/app/parent/view merge.Page::controller()is now public so a controller can fetch another view's data explicitly.Addonno longer overridesrender()/route(): it now just overridesviewRoots()/viewRootsOnly()so the sharedPagelogic resolves an addon's own view tree instead of the site-wide one.Router::clear()renamed toclearRoutes(): hooks are preserved across a clear, only routes are discarded.
Removed
- Per-page-folder
router.phpoverride : router resolution is now purely$page->view()->routerFile().