Create route/view/controller dynamically using a dashboard with slim PHP

you could crate a generic:

$app->get(’/gallery/{id}’, ‘GalleryController:gallery’);

in your GalleryController:gallery you can access the id with $args[‘id’], and display the photos belonging to gallery $id.