views:

51

answers:

2

i'm just wondering how can you return the names of the models you've created inside your models folder?

+1  A: 

Due to the fact the models are loaded using the autoloader, the only way you are going to be able to do it is to use something like the DirectoryIterator or glob() to get a list of the PHP files in the models directory as there is no guarantee that all or any of the models are loaded.

Yacoby
A: 

same as above but a little tweak, Create a helper class to fetch all classes inside the model folder by using the directory iterator then append "Model_" at the beginning of each result to get the actual model name. This may fail given additional directories inside the model folder.

Hanseh