Naming Conventions (Conventional Wisdom?)
One strategy that makes it easier to read and understand the Joomla code base is to use naming conventions for files and folders. We saw one example in the previous section. Recall that we got the component name from the "route()" method – in our example, "com_content". Once we knew this, Joomla "knew" to look for a file called "content.php" in the "components" folder. This logic is hard-coded into Joomla. So, for any component, we know the file that gets loaded to start the component's execution.
Once we know about this convention, it is easy to investigate existing components and also to understand how to make a new component. We know to look for a folder called something like "com_mycomponentname" and a file called "mycomponentname.php" in that folder. We also know that, when Joomla encounters a URL that routes to an option called "com_mycomponentname", this file will be executed.
This type of naming convention is used in many places in Joomla. We highlight these as we discuss the various extension types in the next chapters of the book.