From 8b1a9cca9ca949d431f6ef5cf2b1fba0f27b4209 Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Sun, 12 Mar 2023 08:53:24 +0200 Subject: media serve and validate models (abstruct/skeleton) --- html/app/routes/frontend.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'html/app/routes') diff --git a/html/app/routes/frontend.php b/html/app/routes/frontend.php index 1eea46c..8ba7b4f 100644 --- a/html/app/routes/frontend.php +++ b/html/app/routes/frontend.php @@ -19,23 +19,25 @@ Route::notFound( function() { }); // 404 -// Resolve friendly urls -// --- -Route::add('/([0-9a-zA-Z-_]*)', - function($a) { Resolve::url([$a]); } +// Resolve urls +// --- -- -- - - - +Route::add('/course/([0-9a-zA-Z-_]*)', + function($label) { Course::show([$label]); } ); -Route::add('/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)', - function($a, $b) { Resolve::url([$a, $b]); } + +Route::add('/lesson/([0-9a-f]*)/([0-9a-zA-Z-_]*)', + function($ticket, $lesson) { Lesson::show([$lesson, $ticket]); } ); -Route::add('/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)', - function($a, $b, $c) { Resolve::url([$a, $b, $c]); } + +Route::add('/media/([0-9a-f]*)/([0-9a-zA-Z-_]*)/([0-9]*)/', + function($ticket, $type, $id) { Media::serve([$type, $id, $ticket]); } ); // 4-th level paths belong to products // --- -Route::add('/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)', - function($a, $b, $c, $d) { Product::fromUrl($d, [$a, $b, $c]); } +Route::add('/about/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)', + function($a, $b, $c) { Page::show([$a, $b, $c]); } ); -- cgit v1.2.3