DO I UNDERSTAND MVC CORRECTLY?
I've read many posts by the user teresko and I think I finally understand the real concept of modern MVC. I made a diagram of how I understand it to be, I'm hoping somebody can confirm this for me and that maybe this diagram will help some other users.
IS MY PLANNED DIRECTORY STRUCTURE "SMART"?
Also I'd like to get into folder structure. I'm not too sure that I plan on using a very smart/efficient way of structuring them. In my root directory I have 4 folders. The model folder contains 3 subdirectories called data_mappers, domain_objects and services. The presentation folder contains 2 subdirectories naturally called views and controllers. The 3rd folder in my root directory is one of the ones I'm less sure on called lib and contains another 3 sub-folders, scripts, themes, and templates (is this a good place for templates that will be called by view?). And the last folder which I have is called config (if anybody can think of a better name suggestions are welcomed). This is where I will place the router and base classes and any files of that type. I'm not just going for functionality with my framework, I want it to be technically sound, any suggestions/advise are welcome, I want to make sure my understanding up to this point is correct before I start making the index and router etc so I don't have to start over once again. Thanks
IS THIS A GOOD WAY TO GO ABOUT MULTI-LANGUAGE SUPPORT IN MVC?
(A little off topic, but I need to incorporate this into planning my MVC framework, it may be helpful to other users, and in order to answer the question clearly and concisely the structure of the website needs to be understood and it happens to be described in detail in the above)
My website must be available in English and French, both of which I happen to speak. I plan to create two more sub-folders within the templates folder, one called en and and another fr and simply place all of the English templates in en folder and translate them into French and place them in fr folder and set up the website so www.mywebsite.com/en/home shows the template in English and www.mywebsite.com/fr/home shows the template in French.
There will be a main language selection page that will redirect you to either en or fr. Then, I plan to store the 2 letter language code in a $_SESSION variable. The view will use this $_SESSION variable to pick which template to display. This is the way I had done it on the old version of my website. Is this a good way of accomplishing multi-language support in MVC or is there some better way?
What if I want to make the url also appear in French? If I put the view files inside more subfolders and instead of naming them like this: "/presentation/views/news/news.php" name them like this: "/pre sentation/views/news_nouvelles/news.php" and then make the router (urls and routing is one of my weaknesses, but I will learn on my own ;) store everything before the "_" in a variable corresponding to the English url, and everything after corresponding to the French url. This is just a theory and I have not attempted what is in this last paragraph yet, the multi-language support is more for discussion than a question, although once again, it is relevant because a thorough understanding of my framework is needed to answer/discuss language support.