Slim I want to automatically load the corresponding class file via URI

As @Antnee said, you should rethink this routing concept for security reasons. If you want to stick with it, there might be a first approach here: