I am learning Joomla template development by studying and reverse engineering the default Joomla Protostar template. I understand about 80% of what is going on and through learning the basics of php I have been able to replicate it. However, I do not understand what the following chunk of code is doing (it is right at the top of the template after defined('_JEXEC') or die;
// Getting params from template
$params = JFactory::getApplication()->getTemplate(true)->params;
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$this->language = $doc->language;
$this->direction = $doc->direction;
// Detecting Active Variables
$option = $app->input->getCmd('option', '');
$view = $app->input->getCmd('view', '');
$layout = $app->input->getCmd('layout', '');
$task = $app->input->getCmd('task', '');
$itemid = $app->input->getCmd('Itemid', '');
$sitename = $app->getCfg('sitename');
if($task == "edit" || $layout == "form" )
{
$fullWidth = 1;
}
else
{
$fullWidth = 0;
}
A few things I dont get are...
What are these variables such as "$task" since I dont see that they are set as a parameter
Why arent these variables just included like the others and what is $app->input all about?