0

I've been building my own MVC framework inspired in Codeigniter, it's a very basic one, and I got the clue of everything I needed, the only thing annoys me:

Maybe because I wasn't able to reproduce it quickly but instead of having an $route array in the format $route['controller_name'] = 'expression', I made it to parse the URI parameters, as the first one is the controller, the script would look for the file which is named after the controller.

Is this a bad practice? the routes have any other benefit beside being able to call one controller through different URL's or change its name?

tereško
  • 58,060
  • 25
  • 98
  • 150
aleation
  • 4,796
  • 1
  • 21
  • 35
  • 1
    Read this: http://stackoverflow.com/questions/12430181/how-does-mvc-routing-work – Snake Eyes Oct 10 '13 at 11:15
  • So it is basically that, getting to the controller through different url's, although I didn't realize on the language utility, thanks! – aleation Oct 10 '13 at 11:24
  • You have to realize, that there is no law, which designates the "controller" to be first parameter in URL. What if it's "module" or "resource". Don't hardcode your routing system for specific usecase. Also, choosing codeigniter as your inspiration is a really really bad idea. It's filled with bad practices, artifacts from PHP4 and generally low quality code. And it is **not MVC**. Frameworks do not implement architectural design patterns. Your application's code does .. or doesn't. – tereško Oct 10 '13 at 11:40
  • @tereško what would you recommend me to have a look at instead of codeigniter? – aleation Oct 10 '13 at 11:43
  • You should look at all of them and take neither as some gospel. You should also look into OOP practices, principles and law, which would help you to produce better result. – tereško Oct 10 '13 at 12:05

0 Answers0