Hey guys and gals,
I know I could probably be posting this on the Joomla forums but I have come here instead to get a clear explanation from this community because it has always delivered great results in the past. My curiousity on how Joomla's index.php works is getting the best of me lately. For those of you not maybe familar with how the Joomla file structure works everything is launched off a root index.php file and using various includes and require's they have linked together all the elements which deliver the CMS system itself. I quite like this approach because it does keep your root directory looking quite clean. I have spent hours going through the code and trying to figure out how it works with slow progress. What is bugging me is how without switching off of the root index.php it (Joomla) is able to deliver multiple template files and different content for every page. One would think that the basic idea is that you build your template files, every link you click on calls on the template dedicated to that main page/article/post/etc and reloads the main index file thus providing you the appropriate template - I know thats a very basic explanation but I am wondering if anyone familar with this application can elaborate further on how this actually works? Thank you.

Member Avatar

LastMitch

I have spent hours going through the code and trying to figure out how it works with slow progress.

Joomla has it's own tags for index.php file.

If you are gonna to design the template you need to link index.php file.

The question you are asking is not really a question about php code in Joomla.

It's more like how to insert the files in the CMS.

Think of Joomla tags in the index file as Smarty tags or RainTPL tags.

If you understand how it work and know how to design it.

Then this is very simple to understand with Joomla tags in the index file

I think it's got to do with the fact that Joomla is written following the MVC pattern. All the processing and database access is done somewhere behind (model / controller) and the result is displayed thorugh single index.php page (affected also by a template). On their site they say: Joomla! is always accessed through a single point of entry: index.php (see http://docs.joomla.org/Developing_a_Model-View-Controller_Component/1.5/Introduction).