I'm trying to understand how to component com_installer (the componenent for installing the extensions) in the administrator folder in joomla works under the hood. In particular, I'm trying to understand what happens when you submit the uploaded extension zip.
In default.php in
com_installer/views/install/tmpl
I've found the following code:
<form enctype="multipart/form-data" action="<?php echo JRoute::_('index.php?option=com_installer&view=install');?>" method="post" name="adminForm" id="adminForm" class="form-horizontal">
which seems to indicate that the uploaded file is sent to the same install view itself (the same view you are in when you upload the file). Now in the controller that corresponds to the view, it seems like it takes the corresponding model and calls the relevant function in the model to install the extension.
Now what I suspected, is that when you request a certain view, Joomla will first go to the corresponding controller (if any exists) and see if there exists a function with the same name as the view (in the case of the installer, the view is install, there is a controller install with a function install() inside).
However making a simple test for this, where I have a view called contentimporter, and the corresponding controller:
class ContentImporterControllerContentImporter extends JControllerLegacy
{
public function contentImporter() {
$redirect_url = 'index.php?option=com_installer';
$this->setRedirect($redirect_url);
}
now if this function did indeed get called when going to index.php?component=com_contentimporter&view=contentimporter then I would be redirected to the installer component, but I'm not.
Any help as to how I'm thinking wrong would be greatly appreciated!