This is doable by recursively reading filenames in PHP.
But is there any already existing method in Router Class or some other class which can give me names of all controllers ?
Background:
I want to assign URLs to users like :
http://www.example.com/my_user_name
But would not want to have any my_user_name equal to any of CI controllers.
There is no method within CodeIgniter that can provide you with that information.
The CodeIgniter Router tries to load the controller asked for with the passed URL segments. It doesn’t load all controllers, since this would have no purpose.
A suggestion would be extending the router and adding your desired functionality.